Skip to content

Instantly share code, notes, and snippets.

@hamzaakhtar953
Last active August 27, 2020 13:28
Show Gist options
  • Save hamzaakhtar953/e24501c5f05ef508a86eda58a619a47a to your computer and use it in GitHub Desktop.
Save hamzaakhtar953/e24501c5f05ef508a86eda58a619a47a to your computer and use it in GitHub Desktop.
Merging a diverged sub-branch into master

Merging a diverged sub-branch into master

If you have a sub-branch e.g. master-v2 that has way too many changes and diverged from the master branch then in order to force the changes to master branch we use the following.

git fetch
git checkout master
git reset --hard origin/[sub-branch name]
git push origin master -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment