为什么git混淆删除与重命名/复制? [英] Why does git confuse removal with rename/copy?

查看:111
本文介绍了为什么git混淆删除与重命名/复制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

状态报告目前显示如下:

http:// gyazo。 com / 29176f171b2cdd21ba6a929799b45358.png



然而,当我这样做时



git rm include / oogl / Buffer.hpp



发生以下情况:

http://gyazo.com/6c33678bbe4afa2e3ec2cf4a382b637f.png



怎么做我只是让它删除那个文件,让剩下的文件保持独立? 文件。根据两个文件中相同内容的数量启发式检测到重命名,但是这些信息未存储在提交中。稍后查找提交时,Git将再次确定是否启动重命名仅基于新的和删除的文件。所以不要担心。



(请参阅Git FAQ,为什么git没有跟踪重命名?,特别是这个文本:Git有一个重命名命令 git mv ,但这只是为了方便,其效果与删除文件和添加另一个名称和内容不同。


The status report currently shows the following:

http://gyazo.com/29176f171b2cdd21ba6a929799b45358.png

However, when I do

git rm include/oogl/Buffer.hpp

the following happens:

http://gyazo.com/6c33678bbe4afa2e3ec2cf4a382b637f.png

How do I just make it remove that file and leave the rest alone?

解决方案

Git is just removing the file. Renames are detected heuristically based on the amount of identical content in the two files, but this information is not stored in the commit. When you look up the commit later, Git will again determine heuristically if a rename happened based only on the new and removed files. So don't worry about it.

(See the Git FAQ, section Why does git not "track" renames?, and in particular this text: "Git has a rename command git mv, but that is just for convenience. The effect is indistinguishable from removing the file and adding another with different name and the same content.")

这篇关于为什么git混淆删除与重命名/复制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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