git 服务器搭建,在自己服务器上搭建私有仓库
?如果本地已經(jīng)創(chuàng)建了一個Git項目,現(xiàn)在需要同其他人共享代碼,那么需要在服務器端建立一個倉庫。然后將本地的代碼push上去。步驟如下:
?
1. 登錄遠程服務器,創(chuàng)建一個空的倉庫
$ mkdir /usr/loacl/git/sms
$cd sms
$git --bare init
$ git config core.sharedRepository true
$ git config?receive.denyNonFastForwards true
?
2. 本地機器上面操作:
First I removed the old remote using
git remote rm origin$ git remote add origin ssh://git@192.168.18.168/usr/local/git/sms
$?git push origin master
$ git checkout origin/master
$?git branch -f master origin/master
$ git checkout master
?
至此,本地git倉庫已經(jīng)可以fetch,push遠程倉庫了。
http://www.cnblogs.com/xiaoya901109/archive/2012/08/03/2620664.html
來源:http://blog.csdn.net/guhenghong/article/details/23658619
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的git 服务器搭建,在自己服务器上搭建私有仓库的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [置顶] Postman插件下载安装与使
- 下一篇: Git 搭建私有仓库