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 8222133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:10:28+00:00 2026-06-07T14:10:28+00:00

I come from SVN and I am not understanding how the whole Git thing

  • 0

I come from SVN and I am not understanding how the whole Git thing works. I’ve created a remote repo, cloned the repo in my local machine – if I make changes to files in my local machine and try to push those files to the exact remote repo I cloned from I get an error like this.

remote: error: refusing to update checked out branch: refs/heads/master

I browsed through some SO questions regarding the same issue and the most popular solution was creating a bare repository and then committing to it. So what happens when I clone from that new repo – would this happen again? Should I keep creating new bare repos for each commit from my local? I’m confused and it will be great if someone can point me in the right direction.
I think I am doing this completely wrong.

Exact steps I am following:
1) Created a directory in remote server – init as git repo
2) Copied all contents I needed into the server
3) Added the content into git and committed them there
4) Cloned the git repo from remote to my local machine
5) Made a change to a file in my local, added the change to my local and committed it.
6) When I try to push changes made in my local to remote using: git push origin
I get the error message. I’m providing the whole error message below.

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: Auto packing the repository for optimum performance.

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'.
 ! [remote rejected] master -> master (branch is currently checked out)
  • 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-07T14:10:30+00:00Added an answer on June 7, 2026 at 2:10 pm

    Shared / remote repositories use a bare format, meaning they have no working copy. Subversion is the same – the central repository does not have a working copy. Working copies are created via checkouts in subversion, and via clones in git.

    The problem will not continue to occur if you change the remote repository to bare format.

    The workflow is not significantly different than subversion, just an extra step (or two, depending on the commands you use)

    Make changes
    git add (to add the changes to the staging area)
    git commit (to save the changes to the local repo)
    git push (to push the changes to the remote repo)
    

    When you want to pull changes from others from the remote repo, you do a “git pull” which functions similar to “svn update.”

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

Sidebar

Related Questions

I come from an SVN background so I'm not sure what the typical git
I'm quite new to Git: I come from SVN and there I found really
I come from the SVN world so I might not get all the slight
I’ve come to Git from SVN. Formerly in order to update some production site
I am new to GIT (from SVN). When I make a merge, all the
I'm looking at porting my projects to Git from SVN (I'm convinced that Git
Possible Duplicate: git-svn clone | spurious branches I converted an SVN repo to git
Using git-svn it is quite beautiful to use my local git as a svn
I come from a CVS background. I'm currently investigating using SVN for a project.
I am converting a SVN repository to a Git repository following guidance from Pro

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.