Rewrite git remotes programmatically
README.md

git-remote-rewrite #

I hate migrating between gitweb services. But people keep making dumb choices, and web scraping is still too much for me to go back to self-hosting gitweb.

So this tool should help.

Used like:

git-remote-rewrite --name=srht --search=git@git.sr.ht:~dricottone \
    --new-name=tangled --replace=git@tangled.org:dominic-ricottone.com \
    --dry-run

Some tips:

  • Obviously substitute with your own account names/handles.
  • And obviously don't include the --dry-run flag to actually run it.
  • Try git-remote-rewrite --help if stuck.
  • Values can be passed on flags like --flag=value or --flag value, for both long names and short names.
  • The --new-name flag is optional.
  • There is a --pass-on-no-remote flag which may be helpful for scripting a batch rewrite of many repos' origins.