Git Commands

An overview of the most important Git commands

git pull

The "pull" command is used to download and integrate remote changes.

The target (which branch the data should be integrated into) is always the currently checked out HEAD branch. By default, pull uses a merge operation, but it can also be configured to use rebase instead.

The source (which branch the data should be downloaded from) can be specified in the command's options. These options can be omitted, however, if a tracking relationship with a remote branch is set up.

The Git Cheat Sheet

No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!

Important Options

--no-ff

Creates a merge commit even when a fast-forward would be possible.

--rebase

Integrates changes using rebase instead of merge.

Usage Examples

Before using "git pull", make sure the correct local branch is checked out. Then, to perform the pull, simply specify which remote branch you want to integrate:

git checkout develop
git pull origin develop

In most cases, however, your local branch will already have a proper tracking connection with a remote branch set up. This configuration provides default values so that the pull command already knows where to pull from without any additional options:

git pull


Tip

Easy Pull & Push in Tower

In case you are using the Tower Git client, pulling from a remote is very easy: simply drag the remote branch and drop it onto your current HEAD in the sidebar - or click the "Pull" button in the toolbar.


Learn More

About Us

As the makers of Tower, the best Git client for Mac and Windows, we help over 100,000 users in companies like Apple, Google, Amazon, Twitter, and Ebay get the most out of Git.

Just like with Tower, our mission with this platform is to help people become better professionals.

That's why we provide our guides, videos, and cheat sheets (about version control with Git and lots of other topics) for free.