I have a git repo that is a fork of another repo. As a rule I will normally add a remote called upstream, which is the original repo I forked from.
$ git rem
This is a slightly modified version of GoZoner's solution.
You need to capture the info about all the remotes from your repo's .git/config
into a file that you could store outside your git repository. You also need to take care of updating this file every time you add a new remote. This can in fact be added to your git repo, so that the next clone or pull brings in this file.
Starting with git 1.7.10+
, git supports including external config files.
So you can add the following lines to your repo's .git/config
to include the external config file containing the remote info:
[include]
path = /dir1/dir2/repo-remotes.gitinfo