Push remote branch to local repo with different name?

Well, I worked a bit on this, but I could not find the exact answer, so I have to ask.

I have 2 remotes: origin and repo2.

I would like to do something like

git pull repo2 master 

But it will pull the main branch of repo2 into my host. Can I point to another branch to enter my local branch?

+46
git github repository
Aug 20 2018-12-18T00:
source share
2 answers
 git checkout -b myBranchName repo2/master 
+74
Aug 20 '12 at 18:45
source share
β€” -

The git-pull command is a convenience function that does git-fetch and git-merge . If you want to get branches from the new remote without trying to merge it into any working branch, you can simply use git-fetch . Then you can turn to git-branch -av to see all local and remote branches and work on any of them as you wish.

+1
Aug 20 '12 at 18:45
source share



All Articles