How can I see what I am about to push with git?

前端 未结 14 1895
北恋
北恋 2020-11-27 09:06

Is there a way to see what would be pushed if I did a git push command?

What I\'m picturing is something like the \"Files Changed\" tab of Github\'s \"p

相关标签:
14条回答
  • 2020-11-27 09:32

    Use git gui, there you can see a list of what changed in your actual commit. You can also use gitk wich provides an easy interface for reflogs. Just compare between remotes/... and master to see, what will be pushed. It provides an interface similar to your screenshot.

    Both programs are included in git.

    0 讨论(0)
  • 2020-11-27 09:33

    After git commit -m "{your commit message}", you will get a commit hash before the push. So you can see what you are about to push with git by running the following command:

    git diff origin/{your_branch_name} commit hash
    

    e.g: git diff origin/master c0e06d2

    0 讨论(0)
提交回复
热议问题