How do I see my local unpushed commits?

This question already has an answer here:

  • Viewing Unpushed Git Commits 24 answers

  • I generally use gitk --all for that (after a git fetch --all ).

    And, for console mode, I have an alias of git log --graph --all --decorate --oneline which gives a nice and compact overview of your branches. In particular, it shows what you can push.

    For both these commands you can specify branches ( test origin/test in your case) instead of showing them all with --all .


    First fetch the remote's changes to your local repository:

    git fetch origin test
    

    This will place all commits from the remote's test branch in origin/test . Now you can use git log :

    git log origin/test..test
    

    That will show all commits on test that are not reachable from origin/test .

    链接地址: http://www.djcxy.com/p/7566.html

    上一篇: git:检查本地工作副本和远程工作副本之间的差异

    下一篇: 我如何看到我的本地未完成提交?