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

前端 未结 14 2044
北恋
北恋 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:29

    For a list of files to be pushed, run:

    git diff --stat --cached [remote/branch]
    

    example:

    git diff --stat --cached origin/master
    

    For the code diff of the files to be pushed, run:

    git diff [remote repo/branch]
    

    To see full file paths of the files that will change, run:

    git diff --numstat [remote repo/branch]
    

    If you want to see these diffs in a GUI, you will need to configure git for that. See How do I view 'git diff' output with a visual diff program?.

提交回复
热议问题