Skip to content

Instantly share code, notes, and snippets.

@neolit123
Created March 16, 2020 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neolit123/059f2e51dacb055bef21bb5aa0dcd6ae to your computer and use it in GitHub Desktop.
Save neolit123/059f2e51dacb055bef21bb5aa0dcd6ae to your computer and use it in GitHub Desktop.
kwebsite-rebase
# `origin` is this repository, 'github' is the remote fork
# and '1.18-kubeadm-upgrade' is the remote branch
git checkout 1.18-kubeadm-upgrade
# create a patch between current PR branch and dev-1.18
# results in '0001-kubeadm-update-upgrade-documentation-for-1.18.patch'
git format-patch dev-1.18
git checkout master
# delete old branches
# at this point dev-1.18 was rebased remoteley and just pulling it locally
# would cause conflicts.
git branch -D dev-1.18
git branch -D 1.18-kubeadm-upgrade
# fetch a new dev-1.18
git fetch origin dev-1.18:dev-1.18
git checkout dev-1.18
git checkout -b 1.18-kubeadm-upgrade
# apply the patch
git am -3 0001-kubeadm-update-upgrade-documentation-for-1.18.patch
# 'git am' would fail, fix conflicts here
git add -u
git am --continue
# force push the local branch to the remote
git push -f github 1.18-kubeadm-upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment