Git Pull Remote Branch
Let’s say your local branch is out-of-date, and you need to fetch changes from your remote branch in order to bring your local branch up to speed.
In order to fetch these changes from your remote, or in other words, download the changes to your local branch, you will perform a Git.
By default, Git will technically perform a Git fetch followed by a Git merge for the branch that you currently have checked out.
GitTip: See the step-by-step process of how to checkout a Git branch locally and how to checkout a remote Git branch.
“I use @GitKraken because I can concentrate to get the job done rather than trying to remember the commands and trying to imagine how the branches connect.” – @palmiak_fp
How do you Git pull a remote branch in GitKraken?
Pulling changes from a remote Git branch is far more simple using the visual assistance of the incredibly powerful GitKraken Git client.
In this example, we’re going to fetch changes from a remote branch and bring the local branch up to speed.
To fetch changes in GitKraken, simply click the Fetch button in the top toolbar and select one of the Pull options from the dropdown menu. This will fetch the remote for your currently checked out branch and merge the associated changes into your local branch.
You can see there are multiple options to choose from when you want to Git pull a remote branch in GitKraken.
GitKraken allows you to easily choose between performing a Git pull with fast forward, fast forward only, or a Git pull rebase. No need to remember or type any commands!
How do you Git pull a local branch in GitKraken?
In GitKraken, you can quickly pull any local Git branch by right-clicking the branch from the left panel.
GitKraken’s easy-to-read commit graph will help beginners and advanced users alike visualize branch structure so you know exactly who made what code changes when, even activity on your forks and remotes.
How do you Git pull a remote branch in the command line?
If you’re using the terminal, you will get started with the following command:
If a merge is not required, Git will fast forward your local branch. This means that your local branch will now be pointing to the most recent commit from your remote branch without merging. However, if a fast forward is not possible because a merge is required, a merge will be executed instead.
GitTip: Learn more about how to merge a Git branch, including how to merge a Git branch with master.
git pull --ff-only
You may choose to pull a branch using only fast forward if you only want non-conflicting changes brought in and never want a merge executed.
Now, if you would prefer to pull a branch only using fast forwarding, you can append the --ff-only flag to the git pull command.
Git Pull Rebase
Alternatively, if you prefer to perform a Git rebase when combining file changes, you may choose to rebase the commits from the remote Git branch you are pulling, rather than merging them.
You can accomplish this with the --rebase flag.
git pull --rebase
Have you ever attempted a Git interactive rebase? You will be blown away by how easy it is to perform complex Git actions, such as rebase and interactive rebase, with the GitKraken Git GUI. Plus, you will streamline the process for easier, but more common, actions, like pulling a remote branch.