Pull remote branch into local repo with different name?

Cosmin Atanasiu picture Cosmin Atanasiu · Aug 20, 2012 · Viewed 50.8k times · Source

Alright I did a little bit of research on this but I couldn't find an exact answer, so I have to ask.

I have 2 remotes: origin and repo2.

I'd like to do something like

git pull repo2 master

But this would pull the master branch of the repo2 into my master. Can I specify a different branch to pull into, for my local branch ?

Answer

KingCrunch picture KingCrunch · Aug 20, 2012
git checkout -b myBranchName repo2/master