P
P
Pervachok2017-04-19 11:25:12
git
Pervachok, 2017-04-19 11:25:12

How to pull the contents of a specific branch in git?

I clone the whole project and end up on the master branch, then I do a git checkout on the desired branch, but how do I pull the files of this branch?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Learn Prog, 2017-04-19
@wantknow

git clone -b <branch> <remote_repo>

O
Oleg, 2017-04-19
@Austin_Powers

git checkout origin/*your_need_branch_name* -b *your_branch_name*

J
jcmvbkbc, 2017-04-19
@jcmvbkbc

how to pull files from this branch?

git fetch <remote> <branch> -- even if the remote has 100500 branches, this command will only fetch one -- branch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question