在xcode里面建立github

heihahu 2014-09-10

GitHub Setup

  1. Create repository on GitHub
  2. Get SSH URL such as: git@github.com:ACCOUNT/PROJECT.git
  3. Generate and add your Public SSH key to your GitHub Account (You can follow this tutorial (https://help.github.com/articles/generating-ssh-keys), just steps 1. up to 6.; don't do steps 7. and on).

XCode Setup

  1. Create a new project in XCode (DO NOT select the local git repository/source control option, we will do this manually).
  2. Close XCode (important!).

Local Git Setup

  1. Browse to the project path where the .xcodeproj file is.
  2. Execute the following from your command line:

    git init
    git add .
    git commit -m 'Initial commit from local git'
    git remote add origin git@github.com:ACCOUNT/PROJECT.git
    git pull origin master
    (VIM editor opens)
    Hit 'i' to add a comment, for example 'Initial merge to sync local git with remote git'. 
    Hit 'ESC'.
    Hit 'ZZ'.
    (VIM editor closes)
    git push origin master

Finally, open project on XCode. If everything went OK you'll see Source Control is configured for GitHub use.

If you try it please let me know how it goes.

相关推荐

APCDE / 0评论 2019-12-01
野生的世界 / 0评论 2015-10-29