Repository navigation
Better backport commands #115
Copy link
Copy link
Closed
Description
Activity
- yeah, we can update if you wish, in general we may want also reset --hard upstream/tag, but as many instructions those will often vary, for example in your instructions you refer to upstream with the upstream name, but it often might not be the case. I believe there is even a way to create a branch based on a tag in a single command git checkout -b autobacport-xxx origin/3.6.x…On Fri, Oct 20, 2023 at 21:45 Michał Krassowski ***@***.***> wrote: I wonder if backporting instructions would be more helpful if instead of: git checkout 3.6.x git pull git cherry-pick -x -m1 1728207ffbad5baea1e77e4005230632bf6f16a6 git commit -am 'Backport PR #15279: Update benchmark reporter snapshots' git push YOURFORK 3.6.x:auto-backport-of-pr-15279-on-3.6.x it was: git checkout 3.6.x# (change 1) git pull # if on a fork, use `git fetch upstream && git merge upstream/3.6.x`# (change 2) git checkout -b backport-of-pr-15279-on-3.6.x git cherry-pick -x -m1 1728207ffbad5baea1e77e4005230632bf6f16a6 git commit -am 'Backport PR #15279: Update benchmark reporter snapshots'# (change 3) git push --set-upstream origin backport-of-pr-15279-on-3.6.x Why? 1. Larger projects often work using forks where git pull is often not enough 2. Creating a new branch early avoids having to reset our old branch when doing multiple backports 3. Is not strictly required for users with push.autoSetupRemote but I personally find it safer to have an explicit target What do you all think? — Reply to this email directly, view it on GitHub <#115>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACR5TYQ4KXI6VVR3UJCS4TYALIFHAVCNFSM6AAAAAA6JP26MOVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE2TIOJSGYYDMMY> . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
I had the exact same thoughts and made #168 (only difference is that I didn’t think of
--set-upstream).So I think these instructions are probably an almost ideal shape as multiple people came up with the same ones.
In my version, I address the
upstreamandoriginthing by mentioning them, clarifying where each branch is supposed to come from / go to.
Metadata
Metadata
Assignees
Labels
No labels
I wonder if backporting instructions would be more helpful if instead of:
git checkout 3.6.x git pull git cherry-pick -x -m1 1728207ffbad5baea1e77e4005230632bf6f16a6 git commit -am 'Backport PR #15279: Update benchmark reporter snapshots' git push YOURFORK 3.6.x:auto-backport-of-pr-15279-on-3.6.xit was:
Why?
git pullis often not enoughpush.autoSetupRemotebut I personally find it safer to have an explicit targetWhat do you all think?