I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my xcode project file, and then I started getting issues with UserInterfaceState.xuserstate constantly updating... Later learned that .gitignore would have been good to have in place.

Back to the drawing board and I've been trying to take the new (old) project and enable git on it with the following:
$cd path/to/project
$git init
$git add .
$git commit -m "Initial commit of project"

This works fine, now I'm back in XCODE, and add the repository, which it recognizes in Organizer. One Issue is XCODE doesn't recognize that I've modified a file, and the majority of the "Source Control" menu items are disabled, Ex: "Commit"

I'm wondering if there are a recommended # of steps to:

1) Get Git running on a xcode project that wasn't set up this way initially
2) Steps to add the Gitignore file and when

* Ultimately would like the "Source Control" menu items enabled again.

I'm obviously learning some Git SCM related items with xcode 4, and I appreciate your feedback!
['https://Stackoverflow.com/questions/6039356', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/415640/']
Maybe this isn't the answer you want but I gave up on getting Xcode4 to play well with git and just started using the excellent (and free) [SourceTree](http://www.sourcetreeapp.com/). It really made my life easier.
To add Git to the project

1. Go to the directory and in a terminal window

```
cat > .gitignore
build/*
*.pbxuser
*.perspectivev3
*.mode1v3
javascripts/phonegap.*.js

```

Type Ctrl+D to close the file.
2. Initialize the Git repository

```
git init
git add .
git commit -m

```
3. Add the repository in organizer. Use the full directory path.

Caveat - this still does not enable Source Control menu items. But you can use git from the command line.
See other related post: [Using Git with an existing XCode project](https://stackoverflow.com/questions/5383609/using-git-with-an-existing-xcode-project)