⇦ Back

WDX-180

Web Development X

The pull command retrieves and integrates changes from another repository or local branch. This command is like a combination of the fetch and merge commands and is often used for the following:

Functionally, the pull command is a fetch command followed by a merge command.

Pulling a repository allows programmers to access code from a remote backup and make it available on their local machine. It is also used when collaborating with others in order to keep the local code up to date with the team’s current version.

Syntax

git pull <remote-name> <branch-name>

This will move the code from <remote-name> currently in branch <branch-name>, and move it to the branch checked out locally on the user’s computer.

How to Pull

Prerequisites to pulling from a remote repository include:

At this stage, pulling can be accomplished with a valid remote and branch name:

git pull origin new-feature-branch

When the pull completes, it will display a message like this:

remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/CodeNinja/product-dev.git
  * branch      new-feature-branch    -> FETCH_HEAD

Project maintained by Behsolo Hosted on GitHub Pages — Theme by mattgraham