无root权限新建git仓库进行多人协同工作
build your own git reposity
建立服务器端
从头新建
mkdir gitrepo chown harriszh:harriszh /home/harriszh/gitrepo git init --bare /home/harriszh/gitrepo/memtrans.git
基于已有工作区
git clone --bare memtrans memtrans.git
建立客户端
git init git add . git commit -m "first commit" git remote add origin harriszh@sj-harriszh:/home/harriszh/gitrepo/memtrans.git git push -u origin master
默认每次都要输入密码
可以配置默认的branch
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = harriszh@sj-harriszh:/home/harriszh/gitrepo/memtrans.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master
权限
修改repo文件的读写执行权限
chmod g+wx /home/harriszh/gitrepo/memtrans.git
注意点
客户端每次修改时先git pull
从服务器端拉回最新修改再进行修改和git push
, 这样可以减少很多冲突
相关推荐
LynnOhYeah 2020-07-18
formula 2020-11-12
huhongfei 2020-11-05
乾坤一碼農 2020-10-27
liumengyanysu 2020-10-22
E哥的aws认证攻略 2020-10-15
tianyafengxin 2020-10-08
guying 2020-10-05
好脑筋不如烂笔头 2020-09-17
nebulali 2020-09-11
佛系程序员J 2020-09-15
fenggit 2020-09-15
JustHaveTry 2020-09-11
兄dei努力赚钱吧 2020-09-06
IngeniousIT 2020-08-25