How to connect a local master to a local branch

I have a remote origin/master and a remote branch remote_branch . I also have a local master and a local branch local_branch . When I try to pull the local master in local_branch using git pull master local_branch , I get this.

 fatal: 'master' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

However, when I do git branch , I see this:

 * loca_branch master 

Why can't I extract from local master ?

+5
source share
3 answers

pull changes from local_branch TO master

 git checkout master git merge local_branch 

pull changes from the TO local_branch wizard

 git checkout local_branch git merge master 

Pull is when you have the "origin" regeneration :)

+7
source

git pull is an alias for git fetch && git merge , which you cannot get from local branches (only from consoles) - in fact you do not need to if you intend to merge master into local_branch , just use git merge master when you are on local_branch

+1
source

As the error message says, master not the repository that it knows about. This is because with git pull master local_branch you say: "Extract the local_branch branch from the remote master repository and merge it into my current branch."

But that is not what you need. You want to say "Merge my local master branch into my local local_branch branch, checking it if it hasn't been," and that will be git checkout local_branch && git merge master

0
source

All Articles