简体   繁体   English

如何在 Git 中显示所有已提交但尚未推送的内容?

[英]How to show all committed-but-not-pushed-yet content in Git?

Time passes, and commits accumulate on my branch.时间流逝,提交累积在我的分支上。 How can I review the changes that piled up in my branch, before pushing them?在推送之前,如何查看堆积在我的分支中的更改?

Thanks.谢谢。

I guess you want to diff the two branches local and remote with the same name.我猜你想区分本地和远程的两个同名分支。

git diff <localbranch> <remote tracking branch>   

for example:例如:

git diff master origin/master

Assuming you are on the branch on which you have been committing:假设您在您提交的分支上:

  1. To list the commits only (without the diff) - git log @{u}..仅列出提交(没有差异)- git log @{u}..
  2. To list the commits with the diff - git log -p @{u}..列出带有差异的提交 - git log -p @{u}..

Yes, the commands end with two dots.是的,命令以两个点结尾。 I am not missing anything.我没有错过任何东西。 :) :)

For people coming from mercurial, this is roughly equal to hg outgoing对于来自 mercurial 的人来说,这大致等于hg outgoing

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

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