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 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.
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