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.
In Tower, you can conveniently perform a drag-and-drop operation to execute several other Git commands, such as merging, rebasing, or cherry-picking.
Learn More
- Check out the chapter Inspecting Remote Data in our free online book
- Find the full command description in the Git documentation
- More frequently asked questions about Git & version control