- 解決無法向新建git倉庫推送分支的問題
問題描述: 在服務(wù)器新建git倉庫后無法向git推送分支
-
報錯信息
Compressing objects: 100% (1372/1372), done. remote: fatal: Unable to create temporary file 'some-repository.git/.git/./objects/pack/tmp_pack_XXXXXX': Permission denied fatal: sha1 file '<stdout>' write error: Broken pipe error: failed to push some refs to 'git@somehost:/some-repository.git'
出錯原因
遠(yuǎn)程倉庫未開放-
解決方案:
- 首先開放遠(yuǎn)程倉庫:
git config core.sharedRepository
- 然后修改權(quán)限:
chgrp -R git . chmod -R g+rwX . find . -type d -exec chmod g+s '{}' +
-
再次推送:
To somehost:some-repository.git * [new branch] master -> dev
友情提示: 向遠(yuǎn)程倉庫已檢出的分支發(fā)起推送也會推送失敗
```
remote error: refuse to update checked out branch: refs/heads/master
remote error: ...
```