Skip to content

Instantly share code, notes, and snippets.

@alexander-schranz
Last active August 4, 2022 08:26
Show Gist options
  • Select an option

  • Save alexander-schranz/d03f7459690adc59583fa289a82ebbbb to your computer and use it in GitHub Desktop.

Select an option

Save alexander-schranz/d03f7459690adc59583fa289a82ebbbb to your computer and use it in GitHub Desktop.
Rebase a pull request to a previous version
# clone repository
git clone git@github.com:your-name/sulu.git
cd sulu
# checkout your branch
git fetch origin
git checkout your-branch
# add target remote
git remote add sulu git@github.com:sulu/sulu.git
git fetch sulu
# rebase from 2.5 to 2.4
git rebase -i sulu/2.5 --onto sulu/2.4
# force push your changes as we did rewrite the git history
git push origin your-branch --force
# change target branch in pull request
# if the ci is not triggered after the target branch change do:
git commit --amend --date="now"
git push origin your-branch --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment