在XCode中为一个预先存在的项目设置一个git仓库 [英] Setting up a git repository in XCode for a pre-existing project
本文介绍了在XCode中为一个预先存在的项目设置一个git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能存在重复:
在现有的XCode项目中使用Git
创建项目后,在XCode中设置git存储库。 (即你在创建项目时没有创建git仓库)
解决方案
- 退出Xcode确保如果这是必要的,但我会这样做以防万一)
- 运行终端
- 进入项目文件夹目录$ b $找到名为UserInterfaceState.xcuserstate的文件,然后将整个文件名复制到./
- echo中。 将UserInterfaceState.xcuserstate文件粘贴到这里> .gitignore
- cat .gitignore
- git init
- git
- git commit -m您可以在此处输入注释。
您现在有一个存储库,并且您的项目受到源代码控制
- Quit Xcode (not sure if this is necessary but I do it just in case)
- Run Terminal
- Get into the project folder directory
- find .
- Find the file that says "UserInterfaceState.xcuserstate" and copy the entire filename up to the ./
- echo "paste the UserInterfaceState.xcuserstate file here" >.gitignore
- cat .gitignore
- git init
- git add .
- git commit -m "You can type a comment here like now under source control"
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)
解决方案
You now have a repository and your project is under source control
这篇关于在XCode中为一个预先存在的项目设置一个git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文