Git如何知道该文件已重命名

Git如何知道该文件已重命名

本文介绍了Git如何知道该文件已重命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





标有黄色框的信息不正确。实际上没有这种重新命名。文件 views / file / create.php 和 views / file / index.php 新创建了两个文件 - views / logo / create.php 和 views / logo / index.php 已创建。

这两个文件集可能看起来(对于Git)非常相似,但事实仍然存在 - 这些不一样,重命名文件。这是一个完整的新文件集,在删除第一组文件前半小时在不同的目录中创建。



由于Git提供的信息不正确,我会喜欢提供我的好奇心,这就是为什么我问。


What algorithm Git uses to determine, that some file was renamed?

This is, what git status produced just a few minutes before:

Information marked with yellow box is incorrect. There was actually no such kind of rename. Files views/file/create.php and views/file/index.php were truly deleted half hour after a completely new set of two files -- views/logo/create.php and views/logo/index.php was created.

Both files sets may seem (to Git) quite similar, but the fact remains -- these are not the same, renamed files. This is a complete new set of files, created in different directory about half an hour before deleting first set of files.

Since information provided by Git is incorrect, I'd like to feed my curiosity and that's why I'm asking.

解决方案

From Wikipedia:

这篇关于Git如何知道该文件已重命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 09:02