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:
Command line is OK, but I'd prefer some sort of GUI (like the screenshot above).
Before you try to push code out to the repository, you should always pull all the current changes from the remote repository to your local machine. Doing so will ensure that your local copy is in sync with the remote repository.
To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.
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?.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With