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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:07:57+00:00 2026-06-14T04:07:57+00:00

I made a local clone of my own github repo, made a different project

  • 0

I made a local clone of my own github repo, made a different project of it, and now I want to push it to github as a new repo. I am forced to create a blank repo on github first, and push into it, as it seems impossible to create a new repo by pushing into it. Now when I do so, I get a common error message:

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 matc
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'.

Cloning the remote (empty) repo into a dummy branch (suggestion elsewhere) didn’t work here, and I cannot modify the settings of the remote repo either. I don’t want to force anything, I want the history to be clear that at one time it was this other github repo.

I also tried to fork the original github repo, and merge with that, but forking my own repo on github doesn’t do anything.

What is the best/cleanest way to achieve what I want?

  • 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-14T04:07:58+00:00Added an answer on June 14, 2026 at 4:07 am

    You need first register a repo(the blank repo you have created on github)in your local repo.

    $ git remote add another_repo git@github.com:XXX.git
    

    then you can push to this repo

    $ git push -u another_repo master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to git and I've made a couple of commits to local repo.
I have created a new project and checked the create a local git repository
I have ONE repository on GitHub , let's call it Repo-1 . I want
On my local machine I have cloned a remote repo, made some changes, commited,
What I'm trying to do is, to get local clone of dropbox project, make
I forked a project in github and then did a git clone on this
I have a repository for project which is on Bitbucket. I clone the repo
I am new to git. I have done a clone of remote repo as
I made an android application which connects to a local web service on my
I made a script that spawns a remote shell or runs a local shell

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.