问题描述
我已经运行了Xcode 5教程,希望做出一些重大更改,但希望将此Xcode 5项目放入存储库。
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.
我已经做了一些阅读,你可以通过转到Xcode - >首选项 - >帐户 - >添加库 - >输入存储库地址来添加一个存储库:
I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository -> Enter the repository address:
在这里为本地存储库(在我的iMac)我想工作?
So what would I input here for a local repository (on my iMac) I'm wanting to work on?
干杯。
推荐答案
我会从命令行执行此操作。
I would do this from the command line.
- 关闭
Xcode。
- 打开
Terminal.app
-
-
$ git init。
li>
- 创建一个
.gitignore
文件来忽略一些你不想跟踪的Xcode和输出文件(见下面)。 li>
-
$ git add .gitignore
-
$ git add。
code> -
$ git commit -a -m初始。
- Close
Xcode.app
- Open
Terminal.app
$ cd /path/to/project/dir
$ git init .
- Create a
.gitignore
file to ignore some of the Xcode and output files that you don't want tracked (see below). $ git add .gitignore
$ git add .
$ git commit -a -m Initial.
示例(但不完整) .gitignore
file:
Sample (but incomplete) .gitignore
file:
build/
*/xcuserdata/
最有可能的是,您希望添加远程跟踪回购,也许在github或bitbucket上(一旦 bare 回购)
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
下次打开Xcode项目时,它将准备好使用源代码。
When you open the Xcode project next time it will be ready for Source Code use.
这篇关于为现有的Xcode 5项目添加本地回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!