Forking public Git repositories to internal Git host, and how to track upstream

179 views Asked by At

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:

  1. Clone the public repo to my workstation
  2. Run git remote rename origin upstream
  3. Create a new repository in the internal Git server's web UI
  4. Run git remote add origin ssh://server.name/repo/path.git
  5. 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>?

1

There are 1 answers

1
larsks On BEST ANSWER

Is this the appropriate way to re-host a public repo on an internal server?

Yes. The --origin option to git clone will let you remove step 2 from your workflow.

Additionally, is there anyway to share the configuration for the upstream repo automatically with anyone who clones the internal repo?

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.