Skip to content

Instantly share code, notes, and snippets.

@dannyroberts
Last active August 29, 2015 14:04
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 dannyroberts/68ddab2a6785985d1842 to your computer and use it in GitHub Desktop.
Save dannyroberts/68ddab2a6785985d1842 to your computer and use it in GitHub Desktop.
Example subtree merge
git remote add -f couchforms git://github.com/dimagi/couchforms.git
git merge -s ours --no-commit couchforms/master
# --prefix lets you specify where to put the submodule code
# the thing after the colon in couchforms/master:couchforms
# lets you specify what part of the submodule code to merge in
git read-tree --prefix=corehq/ex-submodules/couchforms -u couchforms/master:couchforms
git commit -m "subtree merge couchforms into corehq/ex-submodules"
git submodule deinit -f submodules/couchforms-src
git rm -r submodules/couchforms-src
git commit -m 'remove couchforms submodule'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment