[英]Why git push notification number increases for a single commit in SourceTree if I took pull after commit
The MRE: MRE:
1
notified in the git push button in ST.1
通知。2
in the git push button.2
。 Can someone please tell me why?有人可以告诉我为什么吗? Does that number represent no.
那个数字代表否。 of commits, or something else?
提交,或其他什么?
The pull has likely resulted in a merge commit, merging the local changes you had with the 1 remote change.拉取可能导致合并提交,将您拥有的本地更改与 1 个远程更改合并。
--------------L local
--------------R remote
After pull拉后
--------------LM local
/
--------------R remote
You are now 2 commits (LM) ahead of the remote, your original change + the merge with remote.您现在比远程提前 2 次提交 (LM),您的原始更改 + 与远程合并。 Even though your contents are now synced with the remote.
即使您的内容现在已与遥控器同步。
An alternative would be to do a pull-rebase, that will rewrite your local history to replay your changes on the remote:另一种方法是执行 pull-rebase,这将重写您的本地历史记录以在远程重播您的更改:
---------------L local
--------------R remote
After pull-rebase:在 pull-rebase 之后:
--------------RN local
--------------R remote
L will be rewritten to have R as a parent instead and will result in a new local commit (N). L 将被重写为将 R 作为父代,并将导致新的本地提交 (N)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.