synology git server
初始化git仓
- cd /volume1/git/
- git --bare init <repo-name>.git
- chown -R gituser:users <repo-name>.git
- cd <repo-name>.git
- git update-server-info
复制代码
git clone,如果你有改过端口,需要把port改成你现在的端口. 红色部分一般是需要修改的. 按你的实际信息填上.
- git clone ssh://gituser@diskstation.local:port/volume1/git/<repo-name>.git
复制代码
首次提交git需要
- git push -u origin master
复制代码
报错:
1. error: src refspec master does not match any. error: failed to push some refs to 'url'
原因是没有commit.
2. ssh_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
ssh没有正常连上或者权限问题.
|