在 Xcode 中为预先存在的项目设置 git 存储库 [英] Setting up a git repository in Xcode for a pre-existing project
本文介绍了在 Xcode 中为预先存在的项目设置 git 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
在现有 Xcode 项目中使用 Git
创建项目后在 Xcode 中设置 git 存储库.(即您在创建项目时没有创建 git 存储库)
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)
推荐答案
- 退出 Xcode(不确定是否有必要,但我这样做是为了以防万一)
- 运行终端
- 进入项目文件夹目录
- 找到.
- 找到显示UserInterfaceState.xcuserstate"的文件并将整个文件名复制到 ./
- echo在此处粘贴 UserInterfaceState.xcuserstate 文件">.gitignore
- cat .gitignore
- git 初始化
- git 添加.
- git commit -m "你可以像现在一样在源代码控制下在这里输入评论"
您现在拥有一个存储库并且您的项目处于源代码控制之下
You now have a repository and your project is under source control
这篇关于在 Xcode 中为预先存在的项目设置 git 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文