I would like to clone ('fork') a public git repository (residing, say, on GitHub) to our internal network in such a way that whenever a developer clones that forked repository, they automatically get two remotes in their local repository:
origin
(pointing to our internal, forked repository)upstream
(pointing to the original, public repository)
Example
Say we have a public repository at https://github.com/someone/foo.git
I'd now like to have a clone on our internal network at internal-repos:foo.git
.
When the developer clones that repository git clone internal-repos:foo.git
, they should have two remotes in their working copy
origin
pointing tointernal-repos:foo.git
upstream
pointing togithub.com/someone/foo.git
Is that possible? If so, how can I do that? AFACT git remote
only operates on the local configuration.