Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Mastering Terminology [closed]

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.?

like image 745
WinWin Avatar asked Jul 07 '11 14:07

WinWin


2 Answers

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.

like image 122
Fred Foo Avatar answered Nov 14 '22 19:11

Fred Foo


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".

like image 22
VonC Avatar answered Nov 14 '22 19:11

VonC