Bare repo: Not all refs have been pushed

When trying to push a commit to a bare remote repository I’m receiving the following error:

Push: Not all refs have been pushed. 'master' rejected (non-fast-forward) 
refusing to update checked out branch: refs/heads/master. By default, updating 
the current branch in a non-bare repository is denied, because it will make 
the index and work tree inconsistent with what you pushed, and will require 
'git reset --hard' to match the work tree to HEAD.

You can set 'receive.denyCurrentBranch' configuration variable to 'ignore' or 
'warn' in the remote repository to allow pushing into its current branch; 
however, this is not recommended unless you arranged to update its work tree 
to match what you pushed in some other way.        

To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.

error: failed to push some refs to 'server'

I’ve researched the error and it appears to suggest that the repository I’m pushing to is not bare, which is not the case. Could this be an issue with git? I’m using SmartGit client.

  • Revert local Sourcetree repo to master
  • How can I get remote package for Go?
  • git bug or misuse of branching?
  • Use one “main project” as source for many projects: how to do it best with GitHub?
  • Go, go get, go install, local packages, and version control
  • Customize CSH prompt for Git repo
  • I’ve also tried pulling from the remote repo, which doesn’t have any effect.

  • Git ignore for ionic project
  • Git merge other branch into another branch?
  • npm install package from local folder
  • How do I edit past git commits to remove my password from the commit logs?
  • Recover git commits to (no branch)
  • Github API languages endpoint
  • One Solution collect form web for “Bare repo: Not all refs have been pushed”

    Ok thats weird, I definitely checked the git config file previously and it had bare set to true. I’m totally sure of it!

    Also people including myself have been able to push commits to this repo previously. The command you issued returned false, so I rechecked the git config file and bare was set to false. I set it to true and pushed, problem solved!

    git config --bool core.bare
    #returned false

    The config file must have been edited at some point without my knowledge.

    Git Baby is a git and github fan, let's start git clone.