Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better backport commands #115

Open
krassowski opened this issue Oct 20, 2023 · 1 comment
Open

Better backport commands #115

krassowski opened this issue Oct 20, 2023 · 1 comment

Comments

@krassowski
Copy link
Collaborator

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?

@Carreau
Copy link
Contributor

Carreau commented Oct 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants