Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Git

...

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

checkout

To switch to another branch in your local work environment.

...

The command git commit -a first looks at your working tree, notices that you have modified hello.c and removed goodbye.c, and performs necessary git add and git rm for you.

branch

To view a list of existing branches

...

Merge branches fixes and enhancements on top of the current branch, making an octopus merge.

diff

Show changes between commits, commit and working tree, etc

...

Show the whole commit history, but skip any merges

rebase

Reapply commits on top of another base tip.

...

To squash a series of commits into a single commit.

stash

Stash the changes in a dirty working directory away.when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit. 

...

there are cases in which your local changes do conflict with the upstream changes, and git pull refuses and refuses to overwrite your changes. In such a case, you can stash your changes away, perform a pull, and then unstash, like above.

...