Add local repo for existing Xcode 5 Project

后端 未结 3 841
滥情空心
滥情空心 2021-01-30 09:40

I\'ve running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository.

I\'ve done some reading and

3条回答
  •  迷失自我
    2021-01-30 10:32

    I would do this from the command line.

    1. Close Xcode.app
    2. Open Terminal.app
    3. $ cd /path/to/project/dir
    4. $ git init .
    5. Create a .gitignore file to ignore some of the Xcode and output files that you don't want tracked (see below).
    6. $ git add .gitignore
    7. $ git add .
    8. $ git commit -a -m Initial.

    Sample (but incomplete) .gitignore file:

    build/
    */xcuserdata/
    

    And most likely you'll want to add a remote tracking repo, perhaps on github or bitbucket (once a bare repo has been created there):

    $ git remote add origin https://bitbucket.org/yourname/yourrepo.git
    $ git push -u origin --all
    $ git push -u origin --tags
    

    When you open the Xcode project next time it will be ready for Source Code use.

提交回复
热议问题