Git how to pull a remote branch

To pull from a remote branch, you first need to fetch the content of that branch. Then you can pull the content.

Run the following command:

	git fetch BRANCH_NAME

	git pull

Here is an example showing the remote branch calling remote -v. Then it fetches the branch and runs a pull on the content:

The output will be:

$ git remote -v
origin  ssh://username@SERVER:/opt/repositories/hosting/ (fetch)
origin  ssh://username@SERVER:/opt/repositories/hosting/ (push)

Olivier@jupiter MINGW64 (master)

$  git fetch origin
username@SERVER's password:

Olivier@jupiter MINGW64 (master)
$ git pull
username@SERVER's password:
Already up-to-date.



Recent Comments