git 如何检查哪些提交尚未推送到原点?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4082175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I check which commits have not been pushed to origin?
提问by markdorison
I have made commits to my local branch (let's just say master) and have 'git pull'd down changes that others have made. When I run a 'git status', I see something like:
我已经提交到我的本地分支(让我们只说 master)并让 'git pull'd down 其他人所做的更改。当我运行“git status”时,我看到如下内容:
# Your branch is ahead of 'origin/master' by 4 commits.
How can I see a list of the four commits that I have made that have yet to be pushed to origin?
我如何查看我所做的四个尚未推送到源的提交的列表?
回答by ebneter
git diff --stat origin/master
will show the changed files.
将显示更改的文件。
git log origin/master..master
will show the commits.
将显示提交。
回答by Eric
I tend to use gitk (or gitk --all) which will show this history of the branch. It also displays large friendly labels on origin/master and master (and any other tags that you have).
我倾向于使用 gitk(或 gitk --all)来显示分支的历史。它还在 origin/master 和 master(以及您拥有的任何其他标签)上显示大型友好标签。
A more lo tech version is git log --graph
更多的技术版本是 git log --graph