I have a remote repository cloned locally, and over time, I have added local commits to that cloned repository.
Now, whenever I do git status
, I see Your branch is ahead of 'origin/master' by xx commits message.
Q: How do I list only commits made locally, so that I can examine these commits into more detail, and eventually merge some of them into upstream?
You can do it by specifying the range to the log
command:
git log origin/master..master
Use your branch name instead of master, of course.
You can read more for example here: What are the differences between double-dot ".." and triple-dot "..." in Git commit ranges?
Also, read man gitrevisions
.
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