Git Zero to Git Hero

Mastering git requires a mentor. Let me be yours.

Getting started with git

If reading is your thing, be sure to check out these ‘git basics’ guides. All of them cover the same content, but with a slightly different angle.

Hello World
_The Hello World project is a time-honored tradition in computer programming. It is a simple exercise that gets you…_guides.github.com

Get Started with Git
_Version control: It isn’t just for coders anymore. If you’re a writer, editor, or a designer who works iteratively on…_alistapart.com

git - the simple guide
_just a simple guide for getting started with git. no deep shit 😉_rogerdudler.github.io

Git Basics Course
_If you’re serious about pursuing a career as a software developer or designer, at some point, you will need to learn a…_teamtreehouse.com

Okay, so you’ve got the basics. The next question is, how do you improve your git technique and become a git master?

Write better commit messages

Your commit messages exist for you and your benefit, so you’re doing yourself a disservice to not be writing them in a way that will actually be useful to you in a year, six months, a week, a day or even an hour.

Go out and write yourself the best darn messages you can, all the time, with the help of this post from Tim Pope:

A Note About Git Commit Messages
_I want to take a moment to elaborate on what makes a well formed commit message. I think the best practices for commit…_tbaggery.com

Branches and branching strategy

A solid understanding of branching will make sure that your commit logs actually make sense historically, allows you to work with parallel versions of your source code and keep your master branch focussed, neat and tidy.

Our recommended branching ‘strategy’ is:

  • The master branch represents your stable release.
  • The development branch is for your work in progress.
  • Individual features should be developed in their own branch.
  • Features are branched from the development branch.
  • Completed features are merged into the development branch.
  • Stable development branches get merged into the master branch.

To help solidify your knowledge about branches, have a play with this tool:

Learn Git Branching
_A interactive Git visualization tool to educate and challenge!_pcottle.github.io

Craft your commits

“A commit, like a well-designed function or class, should represent a single concept. A distinct, cohesive commit is easy to understand, review, and, if necessary, revert.”

The real world of development is a little messy, but your source code and your git commits don’t have to represent this, and you can perfect the contents of your commit as you make it, so that your commit meets these goals — distinct, cohesive and focussed.

Crafting Commits in Git
_A commit, like a well-designed function or class, should represent a single concept. A distinct, cohesive commit is…_blog.carbonfive.com

Git - Interactive Staging
_Interactive Staging Git comes with a couple of scripts that make some command-line tasks easier. Here, you’ll look at a…_git-scm.com

Use an IDE, like SourceTree

Does branching get you down, and crafting commit messages seem a little overly complex? Learning the basics with the ‘good old console’ has its advantages, but you don’t have to suffer doing things the hard way all the time. Using a more advanced desktop application gives you a much easier way to visualise your code changes and craft your commits, without all the complexity of its command-line counterpart.

Free Mercurial and Git Client for Windows and Mac | Atlassian SourceTree
_SourceTree is a free Mercurial and Git Client for Windows and Mac that provides a graphical interface for your Hg and…_www.sourcetreeapp.com