开发者

Why does git confuse removal with rename/copy?

开发者 https://www.devze.com 2023-02-02 00:39 出处:网络
The status report currently shows the开发者_如何学JAVA following: (source: gyazo.com) However, when I do

The status report currently shows the开发者_如何学JAVA following:

Why does git confuse removal with rename/copy?

(source: gyazo.com)

However, when I do

git rm include/oogl/Buffer.hpp

the following happens:

Why does git confuse removal with rename/copy?

(source: gyazo.com)

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.")

0

精彩评论

暂无评论...
验证码 换一张
取 消