Git: From Zero to Hero

GitHub's Octocat as a puppeteer

Mastering Git workflow

Git

Pronounced /git/

Version
Control
System

Nightmares!

Bliss Dreams! 

Git

Mercurial

GNU Bazaar

Subversion

CVS

You may not know Git

Why?

  1. Meaningless commits
  2. Broken commits
  3. Unnecessary merges (GOTO 1)
  4. Manual bug seeking
  5. Selfish commit messages
  6. Loose control of history

Let's fix that!

First

Things

First

Working Directory

Staging Area

Repository

RAM

RAM

Disk

Stage

Commit

Your Computer / Local / 💻

Local Repository

Disk

Internet / Remote /

Server

Remote Repository

Push

Branches / 🌿

Show me the code tips

Push only meaningful commits

Sources

What's a Meaningful Commit?

  • Separates subject vs body
  • Keep the subject succinct
  • Have consistent format
  • Meaningful commit comes from meaningful changes

Subject vs Body

<type>[optional scope]: short summary

[optional body]

Word wrap:

50/72 Rule

Subject line: 50 columns

Body line: 72 columns

Example

Source Control Tells a Story 

Git Rebase to the rescue

Git Bisect to find bugs

Git Reflog to save our jobs

Conclusions

Source Control is for humans!

Describe why, not what.

Git has a lot of useful tools that we overlook

Git does forgive, but Git doesn't forget.

In case of emergency, use Git Reflog.

Thanks!

Credits

You can find the OctoCats' images in:

 

https://octodex.github.com/

Huge thanks to every author!

Made with Slides.com