问题描述
我有一个由几个人组成的团队,使用git flow方法(主,开发,修补程序,功能,发行版)和远程裸仓库在同一个git仓库上工作.
I have a team of a few people working on the same git repository, using the git flow method (master, develop, hotfixes, features, releases), and a remote bare repository.
我们有一个包含一些提交的修补程序,该提交已成功合并到master中,一切都很好.现在,一周后,又进行了许多更改,在继续进行开发工作之后,我们有了一个发布分支,该分支也未合并到master中.
We had a hotfix with a few commits that was merged successfully into master and all was good.Now, a week later, and a lot of changes later, after continuing to work on develop, we had a release branch that was not merged into master as well.
我们注意到系统中的某些文件已恢复为修复程序之前的状态.这些文件仅在最近提到的修补程序中被触摸过,并且在develop分支中未对它们进行进一步的更改.
We noticed that some files in the system got reverted back to the state they were before the hotfix. These files were only touched lately in the hotfix mentioned, and no further changes were made on them in the develop branch.
奇怪的是,我无法在git日志历史记录中找到一个合并,该合并显示了这些文件中的任何一个冲突,这可能表明某个团队成员遇到了冲突并且无法正确解决.
The weird part is that I can't find a merge in the git log history that shows a conflict on any of these files, which can indicate that a team member got a conflict and didn't resolve it correctly.
我所看到的只是修补程序中的提交,该提交添加了所需的更改,但我找不到以后的提交来还原这些更改.
All I can see are the commits from the hotfix which added the desired changes, but I can't find a later commit that reverts those changes.
我尝试使用git whatchanged -p -r -m -- myfile
,再次看到的只是修补程序中的提交.
I tried using git whatchanged -p -r -m -- myfile
and again, all I see are the commits from the hotfix.
我如何找出这些文件发生了什么?可能是我的存储库中有损坏吗?
How can I find out what happened to those files? Could it be a corruption in my repository?
推荐答案
git为此提供了内置机制.
git has a build in mechanism for that.
平分: https://www.kernel.org/pub/software /scm/git/docs/git-bisect.html
运行此内置工具,您将能够跟踪更改丢失的有问题的提交.
run this build in tool and you will be able to track the problematic commit where your changes disappeared.
在此处阅读更多内容,以了解如何使用它以及如何工作. http://alblue.bandlem.com/2011 /07/git-tip-of-week-git-bisect.html
Read more here to understand how to use it and how it work.http://alblue.bandlem.com/2011/07/git-tip-of-week-git-bisect.html
这篇关于在git中缺少提交中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!