开发者

How to list local commits difference in git

开发者 https://www.devze.com 2023-04-10 02:44 出处:网络
I have a remote repository cloned locally, and over time, I hav开发者_如何学运维e added local commits to that cloned repository.

I have a remote repository cloned locally, and over time, I hav开发者_如何学运维e 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号