Created
April 17, 2015 07:40
-
-
Save laurencer/4933db5349fa9937b765 to your computer and use it in GitHub Desktop.
Merging Git Repositories togther
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export prefix="ssh://git@???:7999/???/" # prefix for the repo | |
export suffix=".git" # suffix for the repo address | |
function merge() { | |
repo=$1 | |
git remote add -f $repo ${prefix}${repo}${suffix} | |
git merge -s ours --no-commit ${repo}/master | |
git read-tree --prefix=${repo}/ -u ${repo}/master | |
git commit -m "Merged ${repo} subtree" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment