I've cloned a Git repository from Assembla by running:
git clone git@git.assembla.com:[my_project].git
How can I share my working repository (located at /usr/local/project
) with another user, so that they can directly fetch/pull from and push to my working repository?
I already try to initialize the Git repository from my working repository by running:
git init
or
git init --bare
Then I used the other computer to push a commit to my working repository, but I receive the error:
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'