Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Problems with denycurrentbranch setting when pushing commits to origin

I set up a Git repository for a development site I'm working on. It's a non-bare repository, since it's the actual development site, so the files need to be there. But I'm running into problems when trying to push changes from my local computer to the dev site. 

Initially I was getting the error message "fatal: bad config value for 'receive.denycurrentbranch' in ./config". After checking its value (it was set to "updateInstead"), and doing some searching online and reading various articles, forum posts, etc., it looked like some versions of Git don't support that value, and if that's the case then you need to set it to "refuse" or "ignore".

I updated Git on my local computer and made sure SourceTree was using the most recent version available for Mac OS X (2.27.0), but I still got the same error.

So I tried both the other settings I'd seen recommended, but refuse just gave me a different error instead ("error: refusing to update checked out branch: refs/heads/master"). Ignore appeared to work, in that it didn't generate any error messages, but then I found that it hadn't actually pushed any changes, just failed silently. So it looks like updateInstead IS the only setting that would allow actually pushing changes, but for some reason SourceTree (and command-line Git also) keep telling me that's invalid. 

I did a little more reading to try and get a better understanding of what was happening, and apparently Git doesn't like to push changes to a non-bare repository if it's to the current branch? But this is a fairly simple respository, on which I'm the only developer, so there only IS one branch. I tried to get a better understanding of what "checked out" meant with regard to the master branch, but as far as I've been able to determine (I am not a Git expert by any means), it just means that's the current active branch?

Obviously I'm doing something wrong, but I'm not sure what. I just want to be able to push changes from my local computer, but also to be able to work directly on the dev site sometimes, and then commit the changes there and pull them to my local. Is there a better way I can make that happen?

1 answer

were you able to resolve this?

Are you able to push into dev and pull into the local?  

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events