[英]in Xcode 4 how to associate a project to the local Git repository I set up?
in Xcode 4 how to associate a project to the local Git repository I set up? 在Xcode 4中如何将项目与我设置的本地Git存储库相关联?
That is: 那是:
From " How to Create Git Repos for Existing Xcode Projects ": 摘自“ 如何为现有的Xcode项目创建Git存储库 ”:
UPDATE: Apparently just initializing an empty repository in the project directory is enough;
更新:显然,仅在项目目录中初始化一个空的存储库就足够了; Xcode autodetects it for you.
Xcode为您自动检测到它。
It be nice if something to that effect was in the documentation.如果文档中有达到此目的的功能,那就太好了。 Thanks to Jason for that ( details here ).
感谢Jason的帮助( 此处有详细信息 )。 Open the project directory in a terminal and type the following:
在终端中打开项目目录,然后键入以下内容:
git init
git add .
git commit -m "Initial commit"
So in your case, it should detect it. 因此,在您的情况下,它应该检测到它。
The OP Greg comments: 格雷格将军评论:
I found out that all I had to do was change a file, and then the Xcode 4 pop up menu for the file did show a source control set of options (previously greyed out) .
我发现我要做的就是更改文件,然后该文件的Xcode 4弹出菜单确实显示了一组源代码控制选项(以前是灰色的) 。
So the initial part of the answer is correct re the manual git commands for creating the git repository.因此,答案的最初部分是正确的,有关创建git存储库的手动git命令。
Otherwise you can try: 否则,您可以尝试:
Not your case probably, but one of the comments mentions : 可能不是您的情况,但是其中一项评论提到 :
If you're switching from an SVN repository (which I was), the trick is to go into your project folder and delete or rename the
.svn
directory.如果您要从SVN信息库切换(我以前是),诀窍是进入项目文件夹并删除或重命名
.svn
目录。
For me it seemed that Xcode would find the.svn
folder first (or preferred it, even though the backing repository was decommissioned), but once it was gone Xcode would happily start using the git repository.对我来说,似乎Xcode会首先找到
.svn
文件夹(即使后备存储库已停用,还是更喜欢使用它),但是一旦消失,Xcode会很乐意开始使用git存储库。
That was actually the issue for another Xcode 4 Git user here on SO . 这实际上是另一个Xcode 4 Git用户在SO上遇到的问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.