cd ~
mkdir project.git
cd project.git
git init --bare
git remote add remote-server ssh://user@remote-ip/path/to/project.git
git push remote-server
3.Server设置
git clone project.git project-name
cd project-name
git checkout xxxbranch
Server hooks设置
cd project.git/hooks
cp post-receive.sample post-receive
编辑post-receive
cd /path/to/project || exit
unset GIT_DIR
git pull
这样当客户端
git push remote-server
时,远程服务器自动同步.
当然如果你需要更明确的指令,可以参考git hooks.
这里仅提供设置说明.
git checkout pvx
git merge dev
git rebase -i HEAD~5 #加数字,表示修改最近几次commit
————————————————
版权声明:本文为CSDN博主「ec_huyinghuan」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/a6383277/article/details/49760911