我通过运行从 Assembla 克隆了一个 Git 存储库:
git clone git@git.assembla.com:[my_project].git
如何/usr/local/project
与其他用户共享我的工作存储库(位于 ),以便他们可以直接从我的工作存储库中获取/拉取并推送到我的工作存储库?
我已经尝试通过运行以下命令从我的工作存储库中初始化 Git 存储库:
git init
或者
git init --bare
然后我使用另一台计算机将提交推送到我的工作存储库,但我收到错误:
Pushing to /usr/local/project/
remote: error: refusing to update checked out branch: refs/heads/master[K
remote: error: By default, updating the current branch in a non-bare repository[K
remote: error: is denied, because it will make the index and work tree inconsistent[K
remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To /usr/local/project/
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/usr/local/project'