Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

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 "pull request" feature. When I issue a pull request, I can look and see what will be pulled in if they accept my pull request: 

image

The command line is OK, but I'd prefer some sort of GUI (like the screenshot above).

1 Answer

0 votes
by (50.2k points)

To get the list of files that are pushed using:

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

example:

git diff --stat --cached origin/master

To get the code difference on the files 

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 need to see the differences in a GUI you need to configure git for it using:

git difftool [filename]

Reference: https://git-scm.com/docs/git-difftool

Browse Categories

...