Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:55:18+00:00 2026-06-04T13:55:18+00:00

I am trying to push to a git repository that is managed by gitosis

  • 0

I am trying to push to a git repository that is managed by gitosis on a server. When I push, I get this error:

william@utapau:~/lyre$ git push
Enter passphrase for key '/home/william/.ssh/id_dsa': 
Counting objects: 9, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 705 bytes, done.
Total 5 (delta 4), 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'.
To r:lyre
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'r:lyre'

I found this question:

Git push error '[remote rejected] master -> master (branch is currently checked out)'

and tried the answer there, with no luck. The remote repository doesn’t have a .git folder because it was set up with gitosis. There should not be a work tree or checked out branch in there.

The repository folder structure looks like this:

william@sirius:/home/git/repositories/lyre.git$ ls -hal
total 40K
drwxr-xr-x   7 git users 4.0K May 24 12:58 .
drwxr-xr-x   5 git users 4.0K May  4  2011 ..
drwxr-xr-x   2 git users 4.0K May  4  2011 branches
-rw-rw-r--   1 git users   66 May 24 12:58 config
-rw-r--r--   1 git users   73 May  4  2011 description
-rw-r--r--   1 git users   23 May  4  2011 HEAD
drwxr-xr-x   2 git users 4.0K May  4  2011 hooks
drwxr-xr-x   2 git users 4.0K May  4  2011 info
drwxr-xr-x 163 git users 4.0K Apr 26 15:26 objects
drwxr-xr-x   4 git users 4.0K May  4  2011 refs

william@sirius:/home/git/repositories/lyre.git$ cd branches/
william@sirius:/home/git/repositories/lyre.git/branches$ ls -hal
total 8.0K
drwxr-xr-x 2 git users 4.0K May  4  2011 .
drwxr-xr-x 7 git users 4.0K May 24 12:58 ..

How can I get out of this mess and push to the repository?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:55:19+00:00Added an answer on June 4, 2026 at 1:55 pm

    PEBCAK. Turns out I did not clone the repository I thought I cloned. I was attempting to push to a non-bare repository.

    On the remote server, the gitosis repository is at /home/git/repositories/lyre.git/ and I also have a clone at /home/william/lyre/.

    On my local workstation I set up ~/.ssh/config like so:

    host r
      user william
    

    When I cloned the repository, I did it with git clone r:lyre and inadvertently cloned the clone instead of the gitosis repo. When I attempted to push, I was indeed pushing to a non-bare repo.

    I changed ~/.ssh/config to this:

    host r
      user git
    

    and all my problems went away. This was all a case of mistaken identity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to push a self-hosted server repository to Git using Git extensions.
I am getting this error when I am trying push my files into heroku
I get the following error when trying to push changes to github from the
I have a suspicion why this error happens when I am trying to push
I have a remote git repository and I am trying to commit and push
I have configured git so that I can push my local dev-repository to my
I am getting this error when I am trying to push to the Heroku
While trying to git push heroku master, I keep getting the error : Counting
I'm using gitosis to host a git repository on my home server. I've set
I'm trying to use hg push to a git repository, but it silently fails.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.