Git和二进制文件的历史 [英] Git and binary files history

查看:140
本文介绍了Git和二进制文件的历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于回答问题的后续二进制> git处理二进制文件以及 git无法很好地跟踪文件历史记录



所以, git无法正确地关注文件历史记录。甚至 git log --follow -M100%--name-only - path-to-my-file 不会这样做,而且我<< href =https://stackoverflow.com/questions/3520023/how-does-git-track-history-during-a-refactoring/3520055#3520055>据推测,告诉它只遵循100 %相似!



然后我们应该使用其他方式来找出谁应该责备,比如 bisecting 。这里的问题是:这些似乎不适用于二进制文件。和赞同Linus ,我们不太可能

最后我的问题在这里是



我们是否有自动化的方式来启用某种 git log /移动的二进制文件?



或者是否有类似的版本控制系统但具有此功能?



作为一种解决方案的例子,我会接受一些安全和简单的方法过滤分支 ,但我从来没有玩过它,并不知道它可能有多危险。在发布这样一个程序后,我们是否能够没有问题地推拉?我们可以轻松还原吗?我们可以追踪旧名称/参考而不会恢复吗?你知道,在一个版本控制系统中,对历史的访问就是一切。

解决方案

过滤器分支是安全的。只要不改变您提供的脚本中的任何内容。我也很喜欢-M选项。 100%不适用于普通文件。试试看。


This is a follow up on some similar "answered" questions about git handling binary files and how git can't follow file history very well.

So, git can't properly follow file history. Heck, even git log --follow -M100% --name-only -- path-to-my-file won't do it, and I'm supposedly telling it to only follow files that are 100% similar!

Then we are supposed to use other ways to find who to blame, such as bisecting. Problem here is: those doesn't seem to work with binaries. And accodring to Linus we are unlikely to get a git log --follow fully working any time soon.

In the end my question here is:

Do we have any automated way to enable some kind of git log to follow renamed / moved binaries?

Or maybe is there any similar Version Controlling System but with this functionality?

As an example of a kind of solution, I would accept some safe and simple way of using filter-branch, but I never toyed with it and got no idea how dangerous it might be. Would we be able to pull and push without issues after issuing such a procedure? Can we easily revert it? Can we track the old names / references without reverting? You know, in a versioning system access to history is everything.

解决方案

filter branch is safe. Just don't change anything in the script you provide. I'm annoyed at the -M option too. 100% doesn't work for regular files either. Try it.

这篇关于Git和二进制文件的历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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