简体   繁体   English

提交分支中的master丢失

[英]commits missing in master from branch

I have a git repo in which some changes went into a release branch, but I've lost track if these are also in master branch. 我有一个git repo,其中一些更改进入了发行分支,但是如果这些更改也位于master分支中,我就失去了跟踪。

Using git cherry I get only 3 commits as missing between master and the release branch. 使用git cherry我在master和release分支之间仅缺少3次提交。

However, on the github page if I go to the release branch, it says that it is 10 commits ahead of master (and even some commits behind master - but I don't necessarily care about that)! 但是,在github页面上,如果我转到release分支,它说它是master之前的10个提交(甚至在master之后还有一些提交-但我不一定在乎)! How is that possible if on the console I get something else? 如果在控制台上我还有其他东西怎么办? Thank you! 谢谢!

How is that possible if on the console I get something else 如果在控制台上我还有其他东西怎么办

First, make sure to do a git fetch, in order to be sure to have the local history of the remote repo origin up-to-date. 首先,请确保执行git fetch,以确保使远程回购源的本地历史记录保持最新。

Second, git cherry , used to see which commits in one branch aren't in the other , works with the content of the commits, not their metadata (date, author, ...). 其次, git cherry用来查看一个分支中的哪些提交不在另一分支中 ,它处理的是提交的内容 ,而不是其元数据(日期,作者等)。
Whereas a branch comparison (simple diff) compare the commits themselves, which have different SHA1. 而分支比较(简单diff)则比较具有不同SHA1的提交本身。 See " git ahead/behind info between master and branch? " in order to get the same result locally. 为了在本地获得相同的结果,请参见“ master和branch之间的信息是否在git之前/之后? ”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM