Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list local commits difference in git

Tags:

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?

like image 782
mr.b Avatar asked Sep 29 '11 20:09

mr.b


1 Answers

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.

like image 196
dmedvinsky Avatar answered Sep 28 '22 02:09

dmedvinsky