在 Xcode 4.3.2 中将现有项目置于源代码控制之下
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11054240/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Putting existing project under source control in Xcode 4.3.2
提问by Carter Pape
I was looking for a way to put my existing project under source control, and I looked at this question, but it looks like that solution only worked with Xcode 4.0 because I can't find a way to do what is advised. I also looked at this question, but that solution doesn't work either because my project isn't currently under source control. How can I get my existing project under source control?
我一直在寻找一种方法来将我现有的项目置于源代码控制之下,我查看了这个问题,但看起来该解决方案仅适用于 Xcode 4.0,因为我找不到执行建议的方法。我也看过这个问题,但该解决方案也不起作用,因为我的项目目前不受源代码控制。如何让我现有的项目处于源代码控制之下?
Edit
编辑
I want it to be a git repository, not subversion.
我希望它是一个 git 存储库,而不是 subversion。
回答by geminiCoder
you can do it in terminal using:
您可以在终端中使用:
cd /to/app/folder
cd /to/app/文件夹
git init
git add .
git commit -am 'a descriptor of your first commit'
This should then be picked up in Xcode, you may need to close and re-open
然后应该在 Xcode 中获取它,您可能需要关闭并重新打开
Hope it helps
希望能帮助到你
回答by KimKha
If you want to get existing project by xcode (not command line), you can follow this:
如果您想通过 xcode(不是命令行)获取现有项目,您可以按照以下步骤操作:
- Open "Welcome to XCode" window (below menu Window, or press Shift-Cmd-1)
- Select "Connect to a repository"
- Paste your git URL, and Next.
- 打开“欢迎使用 XCode”窗口(在菜单窗口下方,或按 Shift-Cmd-1)
- 选择“连接到存储库”
- 粘贴你的 git URL,然后下一步。
You can read more in http://www.mindthe.net/devices/2011/04/28/12-steps-to-using-github-with-xcode-4/
您可以在http://www.mindthe.net/devices/2011/04/28/12-steps-to-using-github-with-xcode-4/ 中阅读更多信息
回答by Zinan Xing
Here're the steps that can achieve this, but requires cloning your existing project to a new one:
以下是可以实现此目的的步骤,但需要将现有项目克隆到新项目:
1, (Assume your project is not already under local source control) Create a new project under LOCAL source control (Please note that adding remote source control at this stage may not be successful)
1、(假设你的项目已经不在本地源码控制下)在LOCAL源码控制下新建一个项目(请注意,此阶段添加远程源码控制可能不成功)
2, Make this new project a clone of your old project - drag files, add frameworks, etc.
2、让这个新项目成为你旧项目的克隆——拖拽文件、添加框架等。
3, In menu "Source Control" -> -> "Configure " In the new window, click on "Remotes" -> "+" -> "Add Remote"
3、在菜单“Source Control”->->“Configure”在新窗口中,点击“Remotes”->“+”->“Add Remote”
4, Name: anything (you can use "BitBucket")
4、名称:任何(可以使用“BitBucket”)
Address: https://[email protected]/accountname/reponame.git
地址:https://[email protected]/accountname/reponame.git
5, "Source Control" -> "Commit"
5、“源代码控制”->“提交”
6, Select "push to remote" at the left bottom corner
6、选择左下角的“push to remote”
7, Click "Commit"
7、点击“提交”
8, Check on BitBucket website to see if it's actually pushed to it
8、查看BitBucket网站是否真的推送给它