Preface

Git is a version control Swiss army knife. A reliable versatile multipurpose revision control tool whose extraordinary flexibility makes it tricky to learn, let alone master. I'm recording what I've figured out so far in these pages, because I initially had difficulty understanding the Git user manual.

As Arthur C. Clarke observed, any sufficiently advanced technology is indistinguishable from magic. This is a great way to approach Git: newbies can ignore its inner workings and view Git as a gizmo that can amaze friends and infuriate enemies with its wondrous abilities.

Rather than go into details, we provide rough instructions for particular effects. After repeated use, gradually you will understand how each trick works, and how to tailor the recipes for your needs.

Other Editions

Thanks!

Kudos to Dustin Sallings, Alberto Bertogli, James Cameron, Douglas Livingstone, Michael Budde, Richard Albury, Tarmigan and Derek Mahar for suggestions and improvements. [If I've left you out, please tell me because I often forget to update this section.]

License

This guide is released under the GNU General Public License version 3. Naturally, the source is kept in a Git repository, and can be obtained by typing:

$ git clone git://repo.or.cz/gitmagic.git  # Creates "gitmagic" directory.

See below for other mirrors.

Links

I once listed some references, but it's too time-consuming to maintain. Besides, anyone can simply use a search engine to find Git tutorials, guides, and comparisons with Subversion, Mercurial, and other version control systems.

Free Git hosting