Reputation: 1803
I have two authoritative git repositories that I need to push to. Pushing to both is done by adding a line to the .git/config file:
[remote "origin"]
url = repository1
url = repository2
as discussed in pull/push from multiple remote locations.
However every time another member of my team makes a new clone. The .git/config file goes back to only having:
[remote "origin"]
url = repository1
Is there a way to "commit" the configuration changes so that the repository is setup by default to push to both authoritative sources?
Upvotes: 0
Views: 121
Reputation: 150745
That's because .git/config
is specific to a local repository and not shared to upstream repositories.
If you need to do this, you could either show your colleague how to configure his repository for multiple upstream repositories, or even more generally, provide a bootstrap script in your repository to set up the upstreams. If this script is in the main repository folder, it will be tracked by git, and can be shared with others who clone the repository.
Upvotes: 1