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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:42:53+00:00 2026-05-16T12:42:53+00:00

I bought a personal dev box which I will use for deploying stuff I

  • 0

I bought a personal dev box which I will use for deploying stuff I create on my laptop. I thought it would be a good idea to use Git for code management. The idea was that I will keep committing on my laptop and when needed, will push the changes to the remote dev box.

  1. I initialized a Git repo on the box and
  2. cloned it on my laptop.
  3. But After doing git push I get this error:

    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

I know that the remote repo was not bare.

I want to ask if the only way to go with my kind of setup is:

  1. Initialize a bare repo on Server
  2. Clone it on my laptop
  3. add new files to the local laptop repo and commit the files
  4. push to the remote dev box repo

Even this setup gives me errors:

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly

EDIT

I tried

git push origin master

Got this error:

error: unable to create directory for .git/refs/remotes/origin/master
error: Cannot lock the ref 'refs/remotes/origin/master'.

Oh dumb me… I think it is sudo as in

sudo make me intelligent

  • 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-05-16T12:42:54+00:00Added an answer on May 16, 2026 at 12:42 pm

    The first message, as you said, was because the remote was not a bare repo.

    The second message was because the bare repo you created had no branches to begin with. When you cloned the repo and checked out a working copy, it created the master branch for you. When you tried to push however, there was no master branch on the remote repo, so it complains.

    Try using git push origin master (or whatever your remote is called) and it should create the branches on the remote for you.

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

Sidebar

Ask A Question

Stats

  • Questions 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you use apache server you can use rewrite mode… May 16, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer I needed to create a new class that extended ScrollView,… May 16, 2026 at 4:58 pm
  • Editorial Team
    Editorial Team added an answer Only seconds after posting this, I thought of an easy… May 16, 2026 at 4:58 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've made it a personal rule to inherit every UI control before using it.
Just bought a 2.4GHz Intel Core 2 Duo iMac with 2GB of memory and
I bought a new Vista PC recently but was having lots of problems getting
I just bought a new computer and I am trying to clone my heroku
i just bought a joomla template from template monster. there is photo gallery on
I already know that BO was bought up by SAP on the cheap, but
as I am developing for iPhone, I've just bought an iPhone 4 to test
I have a list of objects which I built with a class, and one
At work I have used Delphi 6 & 7 Enterprise for several years. A
Possible Duplicate: Business Case for Resharper I've just recently graduated and I'm working for

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.