Created
November 14, 2015 10:11
-
-
Save paoloambrosio/0c4ee240e58e04fa79e4 to your computer and use it in GitHub Desktop.
How to merge multiple git repositories
This file contains 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
#!/bin/bash | |
# This script merges several git repositories named experiment-<name> | |
# into a separate branch of a single repository. | |
mkdir global-repo | |
cd global-repo | |
git init | |
git remote add origin git@github.com:paoloambrosio/experiments.git | |
echo "Each experiment is committed in its own branch" >>README.txt | |
git add . | |
git commit -m 'Possibly the only commit on master' | |
for repo in wiremock-saboteur jmx-vs-agent dssim akka-http-auth packer sysintsim; do | |
git remote add $repo git@github.com:paoloambrosio/experiment-$repo.git | |
git fetch $repo | |
git checkout -b $repo $repo/master | |
done | |
git push --all origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment