I have a remote repository that has some branches that I don't have on my local repository. I want to import ALL branches from the remote repository to my local one. I tried to use "git pull" or "git fetch" and I stayed with the same branches I had before on my local repo. Do you know what can help me?
Asked
Active
Viewed 52 times
0
-
If you do `git branch -a`, do you see the other branches? – Oliver Charlesworth Jul 16 '17 at 19:12
-
1Possible duplicate of [Can "git pull --all" update all my local branches?](https://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches) – mason Jul 16 '17 at 19:12
-
Possible duplicate of [How to clone all remote branches in Git?](https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git) – phd Jul 16 '17 at 20:34
1 Answers
1
git pull origin <remote-branch-name>
ensure to resolve conflicts, if any, then perform merging by commiting
git commit -m "pulled from brach-name"

Makamu Evans
- 491
- 1
- 10
- 25
-
But what if I have 1000 branches in remote repo and I want to bring them all in one command ? – CrazySynthax Jul 16 '17 at 19:40
-
u can also merge online by selecting the relevant branches into master. i believe that can help. – Makamu Evans Jul 17 '17 at 09:46