git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git user survey and `git pull`

From
Shawn Pearce <spearce@spearce.org>
Date
Sep 21, 2006, 16:24 UTC
Message-ID
<20060921162401.GD3934@spearce.org>
I just saw this comment under question 20:
    git-pull's behavior of merging in the first refspec to the
    current branch is very bad and has caused us serious repository
    issues in xorg.

Most of the folks I've been teaching Git to recently have found `git fetch` to be a very counterintuitive command for fetching things. Especially since `git push` is what's used to send changes to the remote repository. They also find `git pull . foo` as a counterintuitive way to merge changes.

Basically I'm seeing users run `git pull` when they probably should have run just `git fetch`; the pull obviously also merges the first refspec in .git/remotes/origin to the current branch and that's usually not what the user wanted, especially when the upstream remote has several branches that the user may be tracking (e.g. stable, dev, experimental).

I think its probably too late to change the UI[*1*] but I think it is definately an issue for folks learning Git. Calling push push, fetch fetch and fetch+merge pull is probably a design flaw. IMHO it probably should have been something like:

  Current            Shoulda Been
  ---------------    ----------------
  git-push           git-push
  git-fetch          git-pull
  git-pull . foo     git-merge foo
  git-pull           git-pull --merge
  git-merge          git-merge-driver

in other words pull does the download and doesn't automatically start a merge unless --merge was also given and git-merge is a cleaner wrapper around the Grand Unified Merge Driver that makes it easier to start a merge.

[*1*] I bet a lot of scripts are currently based on the core
      Git Poreclain level functions.  I try to avoid them myself
      in scripts and go right to the plumbing but not everyone
      does that.
-- 
Shawn.
Next: Petr Baudis
Message 1 of 16 in “Git user survey and `git pull`”
  1. Shawn PearceSep 21, 2006
  2. Petr BaudisSep 21, 2006
  3. Linus TorvaldsSep 21, 2006
  4. Nicolas PitreSep 21, 2006
  5. Junio C HamanoSep 22, 2006
  6. SantiSep 22, 2006
  7. Junio C HamanoSep 22, 2006
  8. SantiSep 22, 2006
  9. Nicolas PitreSep 21, 2006
  10. Shawn PearceSep 21, 2006
  11. Johannes SchindelinSep 21, 2006
  12. Jakub NarebskiSep 21, 2006
  13. Matthias UrlichsSep 22, 2006
  14. Alan ChandlerSep 23, 2006
  15. Johannes SchindelinSep 23, 2006
  16. Jakub NarebskiSep 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.