Possible Duplicate:
Using Git with an existing Xcode project
Setting up a git repository in Xcode after a project was created. (i.e. you did not create a git repository when creating the project)
Once you authenticate into Xcode with your GitHub account, the “Open in Xcode” button will appear for relevant repositories on GitHub. Click the button and Xcode will launch, prompting you to choose a directory to clone the repository to your local machine. Happy cloning!
Push your projectGo to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.
Last answer works OK, but is rather lengthy and incompatible with newer Xcode versions. I will try to reiterate it better:
In that directory, create a text file named ".gitignore", and put the following contents into it:
UserInterfaceState.xcuserstate build *.pbxuser *.perspectivev3 *.mode1v3 *~ *~.nib *~.xib .DS_Store xcuserdata/
In Terminal do the following:
\> cd <path of the repository folder> \> git init \> git add . \> git commit -m "Initial commit - or whatever text you'd prefer"
You're done! Open the workspace/project in Xcode and examine your repository in the organizer window.
You now have a repository and your project is under source control
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With