Internal Repository Setup

坚强是说给别人听的谎言 提交于 2020-01-06 19:58:37

问题


I have jumped on the GIT bandwagon lately. I am confused about which DVCS hosting to use. I am in a notion that i can setup my own thing on a dedicated/vps server.

So, my question is that, how to setup my own internal remote repository management system on the dedicated server that i have?

Please guide.

Regards


回答1:


On the server run the following command in a directory you want to use...

git init --bare

This creates an empty/bare repository on the server.

On the client run the following command in an existing git repository (assume you know how to do this)...

git remote add myserver <url/path>

This adds a remote / link to your server. Path can be local, remote (http, ssh, etc).

  • On a local file system use: ~/myrepo/example.git
  • Using ssh: ssh://username@example.org/~/myrepo/example.git
  • Using http: http://username@example.org/myrepo/example.git

For more info on setting up git over ssh see the following article.

To push code to your server do the following...

git push myserver master

This pushes your commits up to the remote server. Where 'myserver' is the alias you gave to your remote location

git pull myserver master

With git pull you download/pull all the commits from the server.

Edit Github is great and has a lot of additional features, but it is good to know how to set up a git repository yourself.




回答2:


I like Gitosis, it makes setting up repositories very easy. You can find a quick tutorial on their github page (see link).



来源:https://stackoverflow.com/questions/11430186/internal-repository-setup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!