Skip to content

Instantly share code, notes, and snippets.

@mgurov
Last active August 29, 2015 14:23
Show Gist options
  • Save mgurov/c333970b1f8ecd925b0e to your computer and use it in GitHub Desktop.
Save mgurov/c333970b1f8ecd925b0e to your computer and use it in GitHub Desktop.
massive git remote migration
for GIT_DIR in $(find . -name ".git"); do git --git-dir=$GIT_DIR remote -v | cut -d ' ' -f 1 | uniq | grep old_repo | sed 's/old_repo/new_repo/' | xargs -n 2 git --git-dir=$GIT_DIR remote set-url; done
@mgurov
Copy link
Author

mgurov commented Jul 28, 2015

preview: for GIT_DIR in $(find . -name ".git"); do git --git-dir=$GIT_DIR remote -v | cut -d ' ' -f 1 | uniq | grep old_repo | sed 's/old_repo/new_repo/'; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment