简体   繁体   中英

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

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> ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM