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

Re: Git terminology: remote, add, track, stage, etc.

From
Thore Husfeldt <thore.husfeldt@gmail.com>
Date
Oct 20, 2010, 09:53 UTC
Message-ID
<BED961D6-5C2A-4535-B706-BFB9727CE398@gmail.com>
In-Reply-To
<vpq8w1v5gce.fsf@bauges.imag.fr>
On 18 Oct 2010, at 23:41, Matthieu Moy wrote:
Show 6 quoted lines
> We already came up with a better wording, namely "upstream", and used
> in in "git push --set-upstream". Probably a next step would be to
> deprecate any other occurence of --track meaning the same thing (git
> checkout --track seems to me to be a candidate, git branch has both
> --track and --set-upstream). One difficulty is to do that with
> backward compatibility in mind.
I’ve tried to play around with this concept now, *in casu* by trying to edit the Pro Git source.
I’m not sure we all agree on what is what, so let me try to clarify.
In the following, Alice has bobsstuff, bob/master, and (Bob’s) master, which she got from
> alice% git checkout --track -b bobsstuff bob/master
(Or using `git branch`). Git tells her that
> Branch bobsstuff set up to track remote branch master from bob.
(By the way, I think “remote branch” is useful and correct, here.)
Let me see if I can use the proposed terminology:
1. bob/master *tracks* master.
2. bob/master is a remote-tracking branch
3. master is a remote branch
4. bob/master has been marked as "upstream" from bobsstuff 
Is master upstream from bobbstuff as well? The man page of `git branch` seems to think so:
> Furthermore, it directs git pull without arguments to pull from the upstream when the new branch is checked out.
So both bob/master and master are sometimes called "upstream", and both bobsstuff and bob/master are sometimes called "tracking".
Let‘s try to look at the relevant Pro Git section, to get a feeling for how this terminology work when you actually try to explain something well:
Show 6 quoted lines
> 
> ### Tracking Branches ###
> 
> Checking out a local branch from a remote branch automatically creates what is called a _tracking branch_. Tracking branches are local branches that have a direct relationship to a remote branch. If you’re on a tracking branch and type git push, Git automatically knows which server and branch to push to. Also, running `git pull` while on one of these branches fetches all the remote references and then automatically merges in the corresponding remote branch.
> 
> When you clone a repository, it generally automatically creates a `master` branch that tracks `origin/master`. That’s why `git push` and `git pull` work out of the box with no other arguments. However, you can set up other tracking branches if you wish — ones that don’t track branches on `origin` and don’t track the `master` branch. The simple case is the example you just saw, running `git checkout -b [branch] [remotename]/[branch]`. If you have Git version 1.6.2 or later, you can also use the `--track` shorthand:
This is a good section, and explains a lot. But, as with much of the Git documentation, the terminology is undisciplined. Take “tracking branches”. The section is about refs like bobbstuff, which is no longer called tracking, but “a branch that has been configured to set up an upstream relation”. Currently, if I understand the proposed terminology, there is no word for what the Pro Git book calls “tracking branches.” (I’d be happy to be wrong about this.)
Let me try
Show 5 quoted lines
> ### Upstream branches ###
> 
> A local branch can be set up in a direct relationship to a remote branch; we say the that the remote branch is _upstream_. In this configuration, if you type `git push`, Git automatically knows which server and branch to push to. Also, running `git pull` on one of these branches fetches all the remote references and then automatically merges in the corresponding remote branch.
> 
> When you clone a repository, Git automatically creates a `master` branch whose upstream branch is the remote-tracking branch `origin/master`.
This is not really good, because the immediately preceding section is about “remote-tracking branches” (currently called “remote branches”, by the way). And “remote-tracking branches” and “upstream branches” are the same – they both refer to bob/master, but from different perspectives. Now there are two sections about bob/master, yet the conceptually interesting branches are bobsstuff (sometimes called the “tracking branch”) and master (sometimes called the “remote branch”). bob/master is just an elegant implementation that facilitates the communication between these two branches. (This is not impossible to fix with a good rewrite.)
I’d be really happy to rewrite the documentation about this stuff (including submitting a patch to Pro Git and other useful references), but my enthusiasm is tempered by a nagging suspicion that the full terminological effect of no longer having a word for the kind of branch that bobsstuff is has been fully realised. 
Previous: Drew NorthupNext: Matthieu Moy
Message 39 of 59 in “Git terminology: remote, add, track, stage, etc.”
  1. Thore HusfeldtOct 18, 2010
  2. Jonathan NiederOct 18, 2010
  3. reset: accept "git reset <removed file>"Jonathan Nieder, Oct 18, 2010
  4. Junio C HamanoOct 18, 2010
  5. Jonathan NiederOct 19, 2010
  6. Junio C HamanoOct 19, 2010
  7. Jonathan NiederOct 19, 2010
  8. Sverre RabbelierOct 18, 2010
  9. Junio C HamanoOct 19, 2010
  10. Ramkumar RamachandraOct 19, 2010
  11. Jonathan NiederOct 19, 2010
  12. Sverre RabbelierOct 19, 2010
  13. Thore HusfeldtOct 19, 2010
  14. User manual: "You cannot check out these remote-tracking branches"Jonathan Nieder, Oct 19, 2010
  15. Matthieu MoyOct 19, 2010
  16. Nicolas PitreOct 19, 2010
  17. Junio C HamanoOct 19, 2010
  18. 0/4 reset: be more flexible about <rev>Jonathan Nieder, Oct 19, 2010
  19. 1/4 reset -p: accept "git reset -p <tree>"Jonathan Nieder, Oct 19, 2010
  20. 2/4 reset: accept "git reset <tree> <path>"Jonathan Nieder, Oct 19, 2010
  21. 3/4 reset: accept "git reset -- <path>" from unborn branchJonathan Nieder, Oct 19, 2010
  22. 4/4 reset: accept "git reset HEAD <path>" from unborn branchJonathan Nieder, Oct 19, 2010
  23. Junio C HamanoOct 19, 2010
  24. Jonathan NiederOct 19, 2010
  25. Ramkumar RamachandraOct 27, 2010
  26. Drew NorthupOct 27, 2010
  27. Matthieu MoyOct 27, 2010
  28. Ramkumar RamachandraOct 28, 2010
  29. Matthieu MoyOct 28, 2010
  30. Matthieu MoyOct 18, 2010
  31. Miles BaderOct 19, 2010
  32. Wincent ColaiutaOct 19, 2010
  33. Miles BaderOct 19, 2010
  34. Wincent ColaiutaOct 19, 2010
  35. Eugene SajineOct 19, 2010
  36. Paul BolleOct 22, 2010
  37. Eugene SajineOct 22, 2010
  38. Drew NorthupOct 22, 2010
  39. Thore HusfeldtOct 20, 2010
  40. Matthieu MoyOct 20, 2010
  41. Drew NorthupOct 20, 2010
  42. Jakub NarebskiOct 18, 2010
  43. Matthijs KooijmanOct 19, 2010
  44. Jakub NarebskiOct 19, 2010
  45. Thore HusfeldtOct 19, 2010
  46. Jakub NarebskiOct 19, 2010
  47. Michael HaggertyOct 21, 2010
  48. Drew NorthupOct 21, 2010
  49. Thore HusfeldtOct 21, 2010
  50. Drew NorthupOct 21, 2010
  51. Thore HusfeldtOct 21, 2010
  52. Drew NorthupOct 21, 2010
  53. Miles BaderOct 22, 2010
  54. Drew NorthupOct 22, 2010
  55. Porcelain scripts: Rewrite cryptic "needs update" error messageRamkumar Ramachandra, Oct 19, 2010
  56. Ramkumar RamachandraOct 27, 2010
  57. Junio C HamanoNov 5, 2010
  58. Ævar Arnfjörð BjarmasonFeb 12, 2011
  59. Drew NorthupOct 19, 2010

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.