github with XCode - UCSB-CCS-CS/F13-CS1L GitHub Wiki

On this page, post hints about getting XCode to cooperated with github--either links to useful articles, or brief descriptions of steps you need to take to get it to work, problems you might expect and their solutions, etc.

Here is how I (Christian) got Xcode to work with GitHub

  1. Make a new repository for your project, and make sure that the "include readme" box is unchecked so that a readme is not initially included in your repo. For some reason Xcode gives an error if a Readme is initially included.

  2. Follow this guide on generating SSH keys and adding them to GitHub.

  3. Go to your repository on GitHub. In the bottom right corner there should be a textfield with an address in it, and text below it that says "You can clone with HTTPS, SSH, or Subversion". Click on "SSH"

  4. Copy the address in the textfield. It should be something like "[email protected]:your_username/your_repo.git"

  5. Open your project in Xcode. Go to Source Control > Your_Project_Name > Configure

  6. Click on remotes. Click the "+" in the bottom left corner of the window and then chose "add remote". Name it the same as your repository name, and for the address use the address that you copied from GitHub. Click "add remote".

  7. Go to Source Control > Commit. Type your message and then commit your files.

  8. Go to Source Control > Push. Wait a few seconds for it to load and then click push. Congrats, you uploaded your project to GitHub. When you make changes and want to save them on github just commit and then push again.

  9. You can now add a readme in GitHub. If you do so you will need to go to Source Control > Pull before being able to push files again.