I’ve the following git remote configuration in order to push changes to two separate repositories (inspired by pull/push from multiple remote locations):
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@bitbucket.org:sgrodzicki/test.git
url = git@github.com:sgrodzicki/test.git
This works well until I make a new clone somewhere:
git clone git@bitbucket.org:sgrodzicki/test.git
The clone configuration has only one host:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@bitbucket.org:sgrodzicki/test.git
The same thing with the other repository (GitHub):
git clone git@github.com:sgrodzicki/test.git
Then it looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:sgrodzicki/test.git
My question is: how to make these configuration changes visible on both hosts?
The configuration of your remotes isn’t part of the information that’s cloned – like many things in your git directory, it’s considered private information.
You just have to do something like the following in each repository:
… after cloning.