iPhone:如何重新创建XCode内置git存储库? [英] iPhone: How to re-create XCode built-in git repository?

查看:139
本文介绍了iPhone:如何重新创建XCode内置git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在XCode中使用git进行iPhone应用程序开发。

我在几天前开始使用它。



但是在重命名后XCode项目名称,提交不再工作。



所以我尝试重新创建git仓库。

我可以删除旧仓库并且可以使用XCode的组织者创建新的存储库。



但我不知道如何从项目中使用新的存储库。



我调用了提交对话框,不错,但在提交时,我遇到了同样的问题。它看起来像项目名称不会将新项目目录添加到git。 (你通过Xcode改变了项目名称不是,如果你没有,我会重新命名它,然后通过Xcode进行更改。)



第一个因为你已经重建了仓库,所以我会解决你的问题。



问题在于项目没有添加到仓库中。如果你的文件旁边有'?'标记,你只需要做一个源代码管理|添加文件浏览器中的文件(和项目)。



如果这不能解决问题,您可能会将旧项目名称签入存储库(I不知道从Xcode中删除是否真的删除了旧版本库或者只是取消注册
我遇到了这个问题并且从命令行修复了它

pre > cd< project directory>
PATH = $ PATH:/Applications/Xcode.app/Contents/Developer/usr/bin/
git rm<旧项目名称> ;. xcodeproj

最后一个命令给了我一个错误,但似乎从存储库中删除了违规条目。



希望你现在可以开始运行了。



我解决了旧问题存储库,所以我做的是为其他人处于类似的位置。
$ b $(这主要是命令行的东西)
//在Xcode中,添加项目git:在文件浏览器和源代码控制|添加中右键单击该项目该?

  //将git目录添加到您的路径
PATH = $ PATH:/ Applications / Xcode。 app / Contents / Developer / usr / bin /
//进入你的项目目录,对我来说就像
cd〜/ Projects /< project name>

git rm<旧名称> .xcodeproj

git commit -m<提交消息

有几个源文件没有提交,所以我通过右键单击文件并单独提交它们来提交它们。一旦我有一个干净的项目,我对一个文件进行了更改,然后通过文件菜单进行了一次提交,以检查整个项目提交的结果。


I want to use git in XCode for iPhone app development.
I began to use it from few days ago.

But after renaming XCode project name, commiting doesn't work anymore.

So I tried re-create repository of git.
I could delete old repository and could create new repository with XCode's Organizer.

But I don't know how to use new repository from the project.

解决方案

Having just renamed my project, this was an interesting question :)

I called up the commit dialog, and everything looked good, but on committing, I got the same problem. It looks like the project name doesn't add the new project directory to git. ( You did change the project name through Xcode didn't you, if you didn't, I'd rename it back and then change it through Xcode.)

First of all, since you've rebuild the repository, I'll address your problem.

The chances are that the problem is that the project is not added to the repository. If you have '?' marks next to your files, you just need to do a Source Control | Add for the files ( and the project) in the File Browser.

If this doesn't fix it, you may have the old project name checked into the repository ( I don't know if delete from Xcode really deletes the old repository or just unregisters it. I had this problem and fixed it from the command line

cd <project directory>
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin/
git rm <old project name>.xcodeproj

That last command gave me an error, but did seem to remove the offending entry from the repository.

Hopefully, you'll be up and running now.

I fixed the problem by working on the old repository, so what I did is for other people in a similar position.

( This is mostly command line stuff) // In Xcode, add the project to git: right click on the project in the files browser and source control|add. This should make the ? go away.

// Add the git directory to your path
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin/
// go to your project directory, for me that was something like
cd ~/Projects/<project name>

git rm <old name>.xcodeproj

git commit -m "<commit message"

There were a couple of source files that didn't commit, so I committed them with right click on the file and committing them on their own. Once I had a clean project, I made a change to one file and then did a commit through the file menu to check the complete project was committing and it was.

这篇关于iPhone:如何重新创建XCode内置git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆