140

How can I make a pull using Git GUI tool? It seems there is no pull command anywhere.

Is there an equivalent menu option using Git GUI?

Any help will be appreciated.

Dancrumb
  • 26,597
  • 10
  • 74
  • 130
Alberto Montellano
  • 5,886
  • 7
  • 37
  • 53

3 Answers3

147

Well, I found this useful forum post: https://web.archive.org/web/20200211180001/http://git.661346.n2.nabble.com/No-quot-pull-quot-in-git-gui-td1121058.html

A fetch and merge should be done.

It seems you need to go to "Remote" menu, then "Fetch from" option , in my case origin, and then go to "Merge Menu" and then "Local Merge...".

gdelfino
  • 11,053
  • 6
  • 44
  • 48
Alberto Montellano
  • 5,886
  • 7
  • 37
  • 53
  • 15
    I cannot sufficiently emphasize how dumb it is that in the CLI you need only type "git pull" to get a combined fetch and merge, but in the GUI, which should be easier, you must manually fetch and then merge. It not only is easier from the command line, but someone who is even slightly familiar with the CLI will be searching for "pull", and it's not there. Makes no sense – Kaz Vorpal Mar 28 '22 at 16:31
  • the link is dead – CodeToLife Jul 06 '22 at 10:08
95

There is also a way to add the pull command to git gui.

When you open GIT GUI you can open the tab Tools and choose Add option.

You can enter a name, and as command enter git pull

This will add an option under the Tools tab. Just click this and a git pull will be done.

Considering this answer: it's not because a pull can be done that it should be done

jerom987
  • 1,127
  • 9
  • 15
  • 4
    in the dialog that appears after clicking Tools > Add make sure to add `git pull origin master` as the syntax is `git pull ` assuming origin is the remote location from where you want to pull the changes, and also `origin` is set as the name in git gui from Remote > Add > in remote details name was written as origin, else make necessary changes as require for ` name` – John Jul 08 '19 at 06:37
  • 1
    @John True, but not strictly necessary. When the remote and branch aren't specified Git assumes current branch and tracked remote. I actually prefer to just have it execute git pull and add globally (checkbox), since I have different remote names for different projects. – Hummeling Engineering BV Dec 11 '19 at 10:10
6

This entry in .gitconfig works nicely for me:

[guitool "Pull"]
cmd = git pull $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) | tr / " ")

It automatically selects current remote branch.

Instruction above assumes that you've set your upstream prior. If you haven't done so then you can do it using command below. [NOTE: Run the command inside of your repository.]

git branch --set-upstream-to=origin/main master

Above command to set upstream is for a case where your remote is origin and current branch is main.

Kyutae
  • 23
  • 4
Jaroslav Kuboš
  • 663
  • 7
  • 17