Skip to content

Rewrite a git repository URL

Situation could be that you have Ansible related requirements.yml files that you wish to distribute to public users. So in these files you'll use public URLs like this.

- src:
  scm: git

But at the same time you're the developer and owner of those repos so if you run ansible-galaxy you don't want to go via HTTPS but rather via SSH, which would look like

So to rewrite that url you can use the following config in ~/.gitconfig.

[url ""]
  insteadOf =

Last update: September 19, 2021