I have a repository hosted on a server and I want developers to contribute to it. So I tried to clone the repo to my local machine, edit a file and push it back (all on the master branch) as described here in section "Private Small Team".
every time I try to push using git push origin master
I get an error that says:
[remote rejected] master -> master (branch is currently checked out)
I have read the error description git is issuing but unsure on how to proceed.
To squelch this message and still keep the default behaviour, set 'receive.denyCurrentBranch' configuration variable to 'refuse'
Is this safe? Is this the correct way? Why does it happens and is not in the linked example? I am concerned about this sentence mostly:
By default, updating the current branch in a non-bare repository is denied, because it will make the index and work tree inconsistent