Git concepts
What commits, branches, HEAD, merges, rebases and remotes are, with the command and the Innesta page for each.
- What is a commit? A snapshot of the whole project, the commit before it, and the staging area that decides what goes in.
- What are branches and tags? A branch is a name that moves to each new commit; a tag is a name that stays put.
- What is HEAD? Where you are: the name for the commit your working copy was built from, and what detached means.
- What is a merge? Joining two lines of work: a merge commit with two parents, or a fast-forward when there is nothing to join.
- What is a rebase? Replaying your commits on top of another branch: one straight line, made of new commits.
- What is a remote? A copy of the repository somewhere else, the branch that tracks it, and the three commands that move commits between the two.
- What is a stash? Uncommitted work put aside as a commit of its own, so the working copy is clean until you take it back.
- Revert or reset? Two ways back: a new commit that undoes an old one, or moving the branch to where it was.