I have made commits to my local branch (let's just say master) and have 'git pull'd down changes that others have made. When I run a 'git status', I see something like:
# Your branch is ahead of 'origin/master' by 4 commits.
How can I see a list of the four commits that I have made that have yet to be pushed to origin?
In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.
`git log` command is used to view the commit history and display the necessary information of the git repository. This command displays the latest git commits information in chronological order, and the last commit will be displayed first.
git diff --stat origin/master
will show the changed files.
git log origin/master..master
will show the commits.
I tend to use gitk (or gitk --all) which will show this history of the branch. It also displays large friendly labels on origin/master and master (and any other tags that you have).
A more lo tech version is git log --graph
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