开发者

git commit message showing file as 'copied' instead of 'modified'. What are the implications?

strong textgit status shows file as modified, however when commiting it shows the file as been copied ie:

git status

modified: foo/bar/baz开发者_如何转开发.xml

git commit

copied: bar/foo/baz.xml -> foo/bar/baz.xml

Why is it showing this file as copied if it was not. The two files were identical before the change.


git tracks content, not files. if two files are the same (or very much the same) git recognizes them as copied. there shouldn't be any implications from this

in your case both files were identical (100 %), so git has no possibility to know if the file was copied, or just accidentally happened to be the same.

don't worry, git only stores snapshots of the tree to the repository. you can control copy and rename detection for git log with parameters -C and -M, git will then try harder to find renames/copies

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜