This is a follow up on some similar "answered" questions about git handling binary files https://stackoverflow.com/questions/4697216/is-git-good-with-binary and how git can't follow file history very well https://stackoverflow.com/a/6797099/274502.
So, git 无法正确跟踪文件历史记录。哎呀,甚至git log --follow -M100% --name-only -- path-to-my-file
我不会这么做,而且我据推测 https://stackoverflow.com/questions/3520023/how-does-git-track-history-during-a-refactoring/3520055#3520055告诉它只关注 100% 相似的文件!
Then 我们应该使用其他方式 http://git.661346.n2.nabble.com/Directory-renames-without-breaking-git-log-td837434.html找到谁blame, 例如平分。这里的问题是:这些似乎不适用于二进制文件。和根据莱纳斯的说法 https://groups.google.com/forum/?fromgroups#!topic/git-version-control/07oWjHiQTtg我们不太可能得到git log --follow
很快就能全面工作。
到底我的问题是:
我们是否有任何自动化的方法来启用某种git log
跟随重命名/移动的二进制文件?
或者也许有类似的版本控制系统但有这个功能吗?
作为一种解决方案的示例,我会接受一些安全且简单的方法using filter-branch https://stackoverflow.com/questions/5656404/git-move-files-in-history-too,但我从来没有玩过它,也不知道它有多危险。发出这样的程序后,我们是否能够毫无问题地拉动和推动?我们可以轻松地恢复它吗?我们可以跟踪旧名称/引用而不恢复吗?您知道,在版本控制系统中,访问历史记录就是一切。
过滤分支是安全的。只是不要更改您提供的脚本中的任何内容。我也对 -M 选项感到恼火。 100% 也不适用于常规文件。尝试一下。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)