I have around 50 relevant commits on my local git repo, of this list I want to show in a code review only my commits.
But they are mixed with other people commits, and some of my commits are corrections to others, so I don't want to go commit by commit because I would step twice in the same code, for the original and for the correction.
The best thing for me would be to do something like this:git combine-commits 4 9 20 35 67 90 102 > myfile.diff
In such a way that 67 fixes an error on 20 and the diff shows the corrected version.
Is there any way of geting this?
To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.
Merging is Git's way of putting a forked history back together again. The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch.
A merge request (MR) is a request from someone to merge in code from one branch to another. You can create a MR from Assembla by clicking on New Merge Request, which is in almost all of git sub-tabs.
One way would be to create a new working branch based at a point before the oldest commit you want to include, git cherry-pick
the commits you want to review onto that branch and extract the diff from the new branch (just git diff start-ref
when you have your temporary branch checked out). Once you've finished the review you can throw away the temporary branch. One thing to watch out for is that the sha refs on your temporary branch will be different to the ones you started with, but I don't expect that will be a problem.
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