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

  • SEARCH
  • Home
  • 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 8876599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:14:59+00:00 2026-06-14T19:14:59+00:00

I have started git by first clone a repository and then ‘git commit’ but

  • 0

I have started git by first clone a repository and then ‘git commit’ but when i do ‘git push’
I am getting this error: But it said ‘refusing to update checkout branch’?

$ git push
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 2.72 KiB, done.
Total 13 (delta 5), 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 ssh://michael@16.336.22.38/home/michae/scripts
 ! [remote rejected] master -> master (branch is currently checked out)

what does this mean?

I search and read
How to cope with "rejected" on git push?

I even try ‘git push origin HEAD’ that gives me same error:

  • 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-14T19:15:00+00:00Added an answer on June 14, 2026 at 7:15 pm

    There are two types of Git repositories: bare and non-bare. A bare repository just contains the commits, branches, tags, and so on; a non-bare repository also contains a current working copy. If you look at a repository, you can tell if it’s bare. If you have a directory containing the files in your project, as well as a .git directory, that’s a non-bare repository; those files outside of the .git directory are the current working copy. If you have just the contents of the repository, such as refs, objects, and so on, that’s a bare repository. It has no working copy.

    You can only push to bare repositories (unless you override the default configuration). You can pull from a non-bare repository, and pull into a non-bare repository, but you cannot push into one. This is to prevent problems updating the working copy. The working copy is a copy of your current state; you may have edited files, and so on. When you pull into a repository, the latest changes are checked out into your working copy; if you have some local changes that aren’t checked in, they are merged with the changes from the repository you’re pulling from, or the checkout is rejected and you need to fix up your local copy to be able to check out those new changes.

    On a repository you are pushing to, you are not able to immediately make changes if there’s a conflict. The working tree will instead get out of date; what’s in the repo and what’s in the working tree will be out of sync. To prevent this, Git refuses to let you push into a non-bare repo.

    It’s recommended to use a bare repo as your “central” repo, that you push to and pull from, use a non-bare repo for your working tree; where you actually do your work. Since it looks like you already have a repo that you have cloned from, you will need to create a bare repo from that, and update your origin to point to the bare repo instead of the non-bare one. You can create the bare repo with git clone --bare path/to/original/repo path/to/bare/repo.git (it’s customary to name bare repos name.git). If this will be shared between multiple people on the same machine, you should also pass --shared to set up permissions correctly. Then in your working copy, run git remote set-url origin path/to/bare/repo.git, and git remote set-url --push origin path/to/bare/repo.git (or user@host:/path/to/bare/repo.git if you access it over SSH).

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

Sidebar

Related Questions

I have a Git repository which I have started to develop on master branch
When I first started out with this repo, I hadn't used git before and
I'm contributing to LibreOffice and have started learning git. I've cloned the LibreOffice repository
I have just started a new git repository. I followed the directions on github,
I have started using Git in the middle of my project, where the first
we have just started using a git account of our Django website project so
I have started implementing Subscriptions into my app but I cannot get the API
I have started playing with UIProgressView in iOS5, but havent really had luck with
I have started to use git for my projects, when I create a project
I've started project in my first laptop. git init, and start working. Tomorrow i'm

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.