我如何移动文件&在Xcode 4中使用git的文件夹? [英] How can I move files & folders using git in Xcode 4?

查看:98
本文介绍了我如何移动文件&在Xcode 4中使用git的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉Xcode中组和实际目录之间的差异。我总是在finder中创建一个实际的文件夹,并将其拖入项目中,确保未复制'copy'。

I'm familiar with the differences between groups and actual directories in Xcode. I always create an actual folder in finder and drag it into the project, ensuring 'copy' is un-checked.

当我移动文件夹时,我通过引用删除项目只需将它们移动到finder中,然后重新添加即可。

When I move folders, I delete the items by reference only, move them in finder, then re-add them.

现在我第一次使用git,并且在测试中发现如果我删除一个目录使用上面描述的方法,我不能做提交。 Xcode告诉我,它不能切换到目录,因为'没有这样的文件或目录'。从我在网上找到的内容来看,当在Xcode中完成时,git没有被通知目录更改。

Now I'm using git for the first time, and discovered in my testing that if I remove a directory using the method described above, I can't do a commit. Xcode tells me it can't switch to the directory because 'no such file or directory.' From what I've found online, git isn't notified of the directory changes when done in Xcode.

我如何移动文件&在Xcode 4中使用git的文件夹,并让编译器和git知道这些动作,以便我可以提交?

How can I move files & folders using git in Xcode 4 and have the compiler and git be aware of the moves so I can commit?

推荐答案

使用Finder将文件移动到GIT存储库中。

You shall not move files in a GIT repository using the Finder. You'd better use the move command from shell.

然后,您必须手动重新清除XCode中的链接(或再次删除/添加文件)。

You then have to manually redresh links in XCode (or remove/add files again).

移动文件与unix'mv'命令类似,使用'git前缀:

Moving a file is similar to the unix 'mv' command, with the 'git prefix:

git mv path destination

(使用-f小心覆盖目的地)

(use -f to override destination... with caution)

这篇关于我如何移动文件&在Xcode 4中使用git的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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