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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:27:43+00:00 2026-06-17T09:27:43+00:00

I have a local git repository which is a clone of a repository on

  • 0

I have a local git repository which is a clone of a repository on github. Someone has forked the repository and made changes in a new branch on a new repository. I want to move this new branch into my repository (locally to work on it first before merging with the master).

I tried creating a new branch and then pulling from the forked repository but it complains because the new branch is a copy of the master branch as well as the local file changes, so it says

error: Your local changes to the following files would be overwritten by merge.

So how can I pull the branch in the other repository into a new branch on my local repository?

I hope that makes sense. If not, this is my repository: https://github.com/MatthewLM/cbitcoin

As you can see, someone has created a new repository with the branch “linuxBuild”: https://github.com/austonst/cbitcoin/tree/linuxBuild

I want that branch on my local repository for MatthewLM/cbitcoin.

How can I do this?

  • 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-17T09:27:43+00:00Added an answer on June 17, 2026 at 9:27 am

    You need to make sure that git status shows that no unstaged changes exist in your local repository.
    You can do this by first stashing your local changes and than pulling that branch. Afterward you can apply your stash.


    If you want to re-create the branch structure of the fork in your local repository, you can do the following:

    git remote add fork <url of fork>
    git fetch fork <branch>
    git checkout -b fork_branch fork/<branch>
    

    This will create the local branch fork_branch with the same history like <branch> in the fork, i.e. fork_branch will branch off of your master where <branch> does in the fork.
    Additionally, your local branch will now track that branch in the fork, so you can easily pull in new changes committed in the fork.

    I think you still need to make sure beforehand that your working copy doesn’t contain any changes.

    If you do not need to track the fork:

    git remote remove fork
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally new to Capistrano. I have a local git repository that I want to
I currently have a local Git repository, which I push to a Github repository.
I have a git project which is only local, and only has a master
I have a git repository on my local machine that I push to github
I am new to Git. I want to clone a large remote repository lets
We have a git repository which is rather large but which has rather few
I have a git checkout of an svn repository created via git svn clone.
I have a local svn repo on my hard-drive which has directory structure as
I have a local "master" git repository. Every few hours, I 'git push' my
I have a main repository on SVN, which I am synchronizing with a clone

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.