建立远程仓库
git init
初始化git remote add origin ssh://root@ip/~/testgit/.git
建立远程仓库git push origin master
将本地仓库跟踪到git仓库
远程拉取代码
git clone ssh://root@ip/~/testgit/.git
输入root的密码,也可以用其他有访问权限的用户- 以上就可以拉去远程的代码了,不过不能推送
- 若果要推送,需要设置 远程仓库
git config receive.denyCurrentBranch=warn/ignore
,这样就可以远程推送了