开发者

How to list local commits difference in git

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜