I am using SmartGit and I'm trying to push my latest commit to a bare repository, which is definitely bare at /media/webserver/git/projectname, but I keep getting the following output, does anyone have an idea of what is wrong?
Thanks
Push: Not all refs have been pushed.
'master' rejected (non-fast-forward)
Counting objects: 1
Counting objects: 29, done.
Delta compression using up to 2 threads.
Total 15 (delta 11), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
error: failed to push some refs to '/media/webserver/git/projectname'
And the below shows the output of my earlier attempt to Commit & Push before I tried pulling(rebase) the latest changes, and then doing another push which resulted in the above output.
Commit: Not all refs have been pushed.
[master e465187] * My commit message here
6 files changed, 580 insertions(+), 325 deletions(-)
rewrite controllers/courses/views/course_apply.php (98%)
rewrite controllers/mail/cont_mail.php (96%)
'master' rejected (non-fast-forward)
error: failed to push some refs to '/media/webserver/git/projectname'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.