Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Last active September 21, 2016 10:54
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 thom4parisot/2c78ec6e6de6a243ef32ec4a70e35a8b to your computer and use it in GitHub Desktop.
Save thom4parisot/2c78ec6e6de6a243ef32ec4a70e35a8b to your computer and use it in GitHub Desktop.
Moving github.com/bbcrd to github.com/bbc

Install

git clone https://gist.github.com/2c78ec6e6de6a243ef32ec4a70e35a8b.git /tmp/mv


# cd into the git repo you want to migrate
sh /tmp/mv/run.sh
#!/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')
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