I have a git repo that makes use of a few different remote urls. Is there a way I can set things so that these remotes are included in a clone of the repo. As it stands, every time I clone the repo, the clone includes only the standard remote reference pointing to origin.
If I can't get the master (i.e. upstream) repo to store and distribute these remote links, is there any handy way that I can get them to set after cloning that is commonly used. I'd think we could write a hook for this, but there doesn't appear to be a 'clone hook'.
Use GNU Awk to Append Additional Remotes
There is (unfortunately) no post-clone hook, but you can certainly append more than one URL to each remote. For example, on a freshly-clone repository, the following will add two additional URLs to origin:
This will enable you to push all three URLs in sequence when you
git push origin. You can adjust the pattern and print statements to suit if your needs are more complex.