Thursday, August 27, 2009

Some Reasons I Love GIT

It's no secret by now that I'm at a "won't turn back" point in terms of SCM. The fundamental ideas that GIT is based on come through in the use of the system:

1. Reliability: Every change is keyed on a SHA of it's contents. You quickly know if there are any integrity issues.
2. Simplicity: It's just a bunch of files organized by a directories comprised of the first 2 characters of the SHA. In those directories exist the serialized blobs of deltas and other items (trees, commits, tags and branches). The files are named by the remainder of the SHA. It's also snapshot-based as opposed to file-based. Moving a method tracks that as exactly that - not 2 separate changes in 2 different files. It's easy to fix a repository if there was some hard disk corruption.
3. Speed: Everything is compressed so the repositories are 1/10th the size of an SVN repository and hence faster. You have a local copy so looking at the log or doing diffs is almost instantaneous.
4. Power: Forgot to add that other little change in your last commit? No problem just amend. Committed 2 changes at once? No problem, tease apart that last commit into 2+ separate ones.
5. Off-line: never need a server. Even at the current gig, no server software installed anywhere for the centralized repositories. It's just some folders on a mapped drive.
6. Merging: It's built for it. SVN's merge tracking is put in as an afterthought. GIT was designed for it.

There's more and more detail, but I needed to answer the question for Steve Bohlen.

Tuesday, August 18, 2009

GIT shortcuts

Time to revise the GIT short cuts. I've added these in ~/.bashrc:

alias ls='ls -lAXh --color'
alias gup='git push'
alias gdl='git pull'
alias gc='git commit'
alias gl='git log'
alias gd='git diff'
alias gdc='git diff --cached'
alias gdh='git diff HEAD'
alias gb='git branch'
alias gt='git tag'
alias gm='git merge'
alias gs='git status'
alias gco='git checkout'
alias gcl='git clean'
alias grs='git reset'
alias grb='git rebase'