简体   繁体   中英

How to create a git repository on my server from the github server?

I admit the question isn't crystal clear..

I am cloning a github hosted project(askbot).
I want to create my private repository for this project so that my team members can make modifications.

I also want to be able to fetch(or pull) new updates from the original github repository(the project will have new features and bug fixes and so on)

In short, I want a repository that we can push/pull privately and that we can also pull from the original github repository.
Are there special setup needed for this?

git clone will create a full fledged repository. you can work at it, pull from it and push changes to it.

The only problem is, that you cannot push to the currently checked out branch. To solve this you can set up a --bare repository, which has no branch checked out.

You also have to decide, how to access you repository. You can use ssh, git-daemon, or a wrapper like gitolite.

On your working copy you can set up two remotes. One for the upstream and one you your clone.
This allows you to fetch updates from upstream, merge them in your own work, and push it back to your clone.

Hence:

  • decide where to put your private repository and how to access it
  • use git clone --bare $upsteam to create the private repository
  • Clone your working copy for the private repository, creating remote "origin"
  • use git remote add to add another remote "upstream"
  • have fun

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