git clone https://gist.github.com/2c78ec6e6de6a243ef32ec4a70e35a8b.git /tmp/mv
# cd into the git repo you want to migrate
sh /tmp/mv/run.sh
Last active
September 21, 2016 10:54
-
-
Save thom4parisot/2c78ec6e6de6a243ef32ec4a70e35a8b to your computer and use it in GitHub Desktop.
Moving github.com/bbcrd to github.com/bbc
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
#!/usr/bin/env bash | |
find . -type f \ | |
\( \ | |
\( -iname '*.js' -o -iname '*.css' -o -iname '*.sass' -o -iname '*.scss' -o -iname '*.yaml' -o -iname '*.yml' -o -iname '*.less' -o -iname '*.md' -o -iname '*.json' -o -iname '*.html' \) \ | |
-not -iname './node_modules/*' \ | |
\) \ | |
-exec sed -i -f $(dirname "${BASH_SOURCE[0]}")/sedfile {} \; | |
git checkout -b move-to-bbc-org | |
git commit -a -m "Move references from github.com/bbcrd to github.com/bbc" | |
git push origin move-to-bbc-org | |
hub pull-request -m "Move references from github.com/bbcrd to github.com/bbc" | |
git remote set-url origin $(git remote get-url origin | sed -e 's#github.com:bbcrd#github.com:bbc#gi') |
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
s#github.com:bbcrd#github.com:bbc#g | |
s#github.com/bbcrd#github.com/bbc#g | |
s#travis-ci.org/bbcrd#travis-ci.org/bbc#g | |
s#-o bbcrd#-o bbc#g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment