Yesterday, I posted a question on how to clone a Git repository from one of my machines to another, How can I \'git clone\' from another machine?.
I am now
You can get around this "limitation" by editing the .git/config
on the destination server. Add the following to allow a git repository to be pushed to even if it is "checked out":
[receive]
denyCurrentBranch = warn
or
[receive]
denyCurrentBranch = false
The first will allow the push while warning of the possibility to mess up the branch, whereas the second will just quietly allow it.
This can be used to "deploy" code to a server which is not meant for editing. This is not the best approach, but a quick one for deploying code.