Arpit
Arpit

Reputation: 109

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

Upvotes: 0

Views: 792

Answers (3)

Thomas
Thomas

Reputation: 911

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.

Upvotes: 1

Luminous_Dev
Luminous_Dev

Reputation: 614

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.

Upvotes: 0

Shravan40
Shravan40

Reputation: 9908

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

Upvotes: 0

Related Questions