开发者

Git how to find out which single commits that done on one branch and not another

I am about to create a patch file for a project. My branch is the "master" in my local repository. And the remote upstream branch is mapped to the local branch "origin". \ With this command I can compare the two branches开发者_JAVA百科 and see all differences

git diff origin..master

[gives me a full patch format of all commits]

But in this case, I'd like to cherry-pick some of the commits and create a new patch file specificly for the different areas wheere my branch differs. The question is how I can see the individual commits?


To just see the commits you can use

git log origin..master

You can also add the -p option to see the individual patches. If you want to cherry pick commits you can use the git rebase -i option which is pretty neat.

On your master branch:
git checkout -b create-patch-foo
git rebase -i origin

This will let you pick, edit, omit or even squash (combine) commits.


Try git cherry A B or git log --left-right --boundary --oneline A...B.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜