I'm currently working with Puppet modules, and I'm "forking" them from their public repos to an internal Git server. Currently, my workflow is:
- Clone the public repo to my workstation
- Run
git remote rename origin upstream
- Create a new repository in the internal Git server's web UI
- Run
git remote add origin ssh://server.name/repo/path.git
- Finally, push my local clone to the internal server:
git push -u origin master
Is this the appropriate way to re-host a public repo on an internal server?
Additionally, is there anyway to share the configuration for the upstream repo automatically with anyone who clones the internal repo? Or does each user need to manually run git remote add upstream <server>
?
Yes. The
--origin
option togit clone
will let you remove step 2 from your workflow.There is not. You could put together a script that would implement your desired configuration and share that with developers who will be working on the project with you.