Git Cheatsheet for The Rest of Us
2010/08/13
Here at Scalien we've been git users for a while now, with Keyspace being hosted on github. We've had great experiences with both git and Github.
The distributed nature of git is wonderful: we are able to commit locally into the local repo, and later push to the main github repo. Cloning is a great way for everyone to create forks for experimenting around and adding smaller features. Although git in itself is pretty cool, Github is the "killer app": it makes source control management beatiful, gives us a nice clicky interface for repo admin tasks, and lets everyone clone easily. We pay $12 for the small plan, this gives us 10 private repos to keep stealth mode projects in stealth mode. I bought the Pro Git book by Scott Chacon on Amazon for $23, who incidentally works at Github.
Git is all about the command line switches. Over the last couple of months, I've created a nice cheatsheet for our most common (non-trivial) git commands so we don't always end up googling them, mostly based on the Pro Git book and StackOverflow QAs. It also contains the 2+1 major gotchas I've encountered:
- Do not amend commits that you have pushed to a public repository!
- Do not rebase commits that you have pushed to a public repository!
- Always update to the latest git major version (currently at 1.7.x)
Always keep these in mind and your co-developers won't hate you.
Finally, here's the cheat sheet (PDF), and a preview:
- Marton Trencseni
blog comments powered by Disqus
