简体   繁体   中英

Git pull to a non remote branch

I've a branch which I don't want to have as a remote branch since I'm only using it for testing purposes. Now when I try to pull(fetch and merge) from my remote master branch to my branch, I get the error:

fatal: No remote for the current branch.

How can I merge my remote master branch with my non remote branch

Edit: I don't want to merge into and change the local master branch. I want to directly merge the remote master into local testing branch

You can specify the location of your merge branch like this:

git merge origin/master

That will merge the master branch from origin into your local branch.

I hope that you are currently in your local branch, which you don't want to commit.

 $ git commit -am "Commit message"
 $ git checkout master
 $ git pull origin master
 $ git checkout branch_name
 $ git merge master

If i understand you correctly

You have to git pull on to your master branch and then in your non-master branch, "git rebase master"

You need to pull from your master branch to your other branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM