+9 votes
1 view
in DevOps and Agile by (20k points)
edited by

I have a project with multiple branches. I've been pushing them to GitHub, and now that someone else is working on the project I need to pull their branches from GitHub. It works fine in master. But say that someone created a branch xyz. How can I pull branch xyz from GitHub and merge it into branch xyz on my localhost?

1 Answer

+11 votes
by (28.4k points)

The following command works like a charm:

git checkout -b <new_branch> <remote repo name>/<new_branch>

Welcome to Intellipaat Community. Get your technical queries answered by top developers !