9

OK, so I got past the tutorial introduction to git and I know how to:

  • Create an empty local .git object database
  • Add the contents of the entire current working directory to it
  • Commit the addition(s)
  • Name a branch
  • Create a remote repository
  • Push branches.

But going through the initial learning process, I encountered many new terms. I feel that understanding the exact meaning of these terms is crucial to not making irreversible mistakes when working with a live project.

Can you recommend a good source for methodically learning the meaning of key terms like origin, master, commit vs. push, refs, heads, clone vs. checkout, etc.?

Community
  • 1
  • 1
WinWin
  • 7,493
  • 10
  • 44
  • 53

2 Answers2

9

origin and master have no special meaning to Git, they're just conventions. origin is the "main" remote repo (although often, you'll have both an origin and an upstream; the former is your clone, while upstream is a team's common repo). master is just a common name for the main branch. Depending on the project, it's usually the development branch where beta features are merged into and bugfixes are pushed to, though it may be a release branch with development occurring elsewhere.

Commit vs. push is explained at the question you linked to. Just remember that, if you're switching from SVN to Git, "push is the new commit" (to quote a colleague of mine).

You don't really need to learn the others "methodically"; just learn by doing. There's too much to Git to memorize from a book for most mortals. Version tracking software has the specific purpose of making mistakes reversible; just stay clear of --force, git reset and git rebase for now.

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
  • This is an incredibly helpful answer. Thank you very much! (+1 of course) – WinWin Jul 07 '11 at 14:49
  • Yes, I did provide a few links explaining some of the terms. I did so because I wanted to exemplify that I am not alone in facing this challenge when coming from a different VC background and also as a reference to others who may face the same thing after me. :) – WinWin Jul 07 '11 at 14:52
  • @WinWin: I've been using Git successfully for over a year (mostly from the command line) but I only recently learned how to use `cherry-pick` and `rebase` properly. I must admit that I still don't know exactly what heads and refs are, and I've never felt the urge to look them up. – Fred Foo Jul 07 '11 at 14:53
4

One term very important to learn in a DVCS is upstream:
See "Definition of “downstream” and “upstream”"

Considering the difference of workflow between a CVCS (Centralized VCS) and a DVCS (Distributed VCS), it is key to realize you have your repo vs. many "upstream" repos (from which you can fetch from).

The other notion to have a good grasp on is "rebase vs. merge".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, I only came across this now and was wondering about the difference between `upstream` and `origin`. Thanks! – WinWin Jul 07 '11 at 15:33
  • @WinWin: upstream refers to a remote repo. '`origin`' is the default name given to the reference to the remote repo you have just cloned. But this is only a naming convention and you can name your upstream repo as you want when cloning it: `git clone -o github `https://github.com/VonC/compileEverything would clone my GitHub repo and refer to it as 'github' (meaning I would have to `git push github master` instead of `git push origin master`): in that case, I find it more expressive to name the upstream repo 'github' (and not '`origin`' which is a bit generic). – VonC Jul 07 '11 at 15:53