Skip to content

Instantly share code, notes, and snippets.

@khalib
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save khalib/3627ca3c13041455e15a to your computer and use it in GitHub Desktop.

Select an option

Save khalib/3627ca3c13041455e15a to your computer and use it in GitHub Desktop.
Mirror deviated branch to an existing branch
# Branch DEV has extra files and commits that are not needed anymore
# DEV is to be a mirror of MASTER
# Get the latest DEV branch
git checkout DEV
git pull origin DEV
# Get the latest MASTER branch
git checkout MASTER
git pull origin MASTER
# Psuedo-merge DEV into MASTER but only taking MASTER's deltas
git merge -s ours DEV
# Merge MASTER into DEV
git checkout DEV
git merge MASTER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment