I have a list of patch in review on Gerrit (31 patches that follow each other), and would like to know how to pull them all at once on my local git.
I know it is possible to download a patch though the graphical interface:
Checkout: git fetch <url> refs/changes/78/141978/9 && git checkout FETCH_HEAD
Cherry Pick: git fetch <url> refs/changes/78/141978/9 && git cherry-pick FETCH_HEAD
Format Patch: git fetch <url> refs/changes/78/141978/9 && git format-patch -1 --stdout FETCH_HEAD
Pull git pull <url> refs/changes/78/141978/9
Patch-File 376aeb6.diff.base64 | 376aeb6.diff.zip
Archive tgz | tar | tbz2 | txz
I usually fetch the patch and cherry pick it using the command:
git fetch <url> refs/changes/78/141978/9 && git cherry-pick FETCH_HEAD
But I don't want to do this for all the patches I need.
You can use git cherry-pick to get a bench of consecutive patches.
git fetch <url> refs/changes/78/141978/9
git cherry-pick <first-patch-sha>^..<last-patch-sha>
The fetch command will download the patches from the remote repository and the cherry-pick command will apply the changes from <first-patch-sha> included to <last-patch-sha> included.
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