A
A
Anastasia Lashkevich2018-02-19 12:26:04
git
Anastasia Lashkevich, 2018-02-19 12:26:04

How to pull a branch from a remote repository?

I need to pull a remote branch so that only the files of this new branch are in the project folder.
It doesn't work:
git checkout -b <branch name> origin/<branch name>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2018-02-19
@aol-nnov

git fetch origin
git checkout -b <название ветки> origin/<название ветки>

documentation here: https://git-scm.com/book/en/v2

E
Egor Zhivagin, 2018-02-19
@Krasnodar_etc

Why doesn't it work?
Only after checkout you need to pull

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question