Advanced Git Tips and Tricks

About Me

DevOps@RajeshKumar.XYZ


	$ master > git checkout
				

	$ git -­version
	git version 1.8.0
				

Git to me is harder than programming.

- Someone on Twitter

The Command Line


	$
				

Crafting Commits

Study the past if you would define the future.

— Confucius

Atomic

Self-contained

Semantically related changes should not be split across commits.

Coherent

All changes in a commit should be semantically related.

Consistent

No compilation errors

A commit should not introduce compilation errors.

No broken tests

A commit should not break any existing tests nor add failing ones.

Incremental

Ordered

Commits should be ordered deliberately.

Explanatory

The order should be a trail of the programmer's thought process.

Documented

Short summary

A commit message should include a short one-sentence summary.

Detailed description

A longer description can be added if more details are necessary.

Useful Commit Messages

Atomic | Consistent | Incremental | Documented

A | C | D

People can (and probably should) rebase their own work. That's a cleanup.
But never other people’s code. That's a "destroy history".

— Linus Torvalds

Searching History

Branching and Merging

Long-running

Broadly-scoped

Exists for a long period of time, sometimes for the entire project.

Shared

Multiple people or even the entire team collaborate on it.

Topic

Focused

Exists to accomplish one specific task, after which it gets disposed.

Individual or Shared

Used exclusively by its creator or shared among multiple people.

Rewriting History

Questions

THANKS...!