Git in 5 Minutes – and the value of stashing! (#git, #iosdev, #scm)

Good quick help for using Git from Scott Paul Robertson.

Git in 5 Minutes

Git In Five Minutes Many people consider Git to be too confusing or complex to be a choice for version control. Yet Git considers to grow in adoption, and many interesting things have grown up around it. This document is geared for someone wanted to get started with Git, often coming from a Subversion background. For most basic needs this document will cover 70 to 90 percent of your use.

The document has some nice succinct suggestions, but there is a subtle but very important comment he makes in the last subheading, Sweeping Changes Under the Rug for Later, in which he says:

When moving between branches your local changes move with you. Sometimes you want to switch branches but not commit or take those changes with you.

So you begin to learn that stashing (and committing, too) is a very important concept to learn and use effectively… It’s definitely a paradigm shift from the likes of SVN, but having a local repository and set of local branches that you can work with freely and easily is very liberating.

The problem that I foresee is that going back to SVN will be very difficult and constraining after having been exposed to the power and flexibility of Git!

Git Command Shortcuts (#iosdev, #git, #tipsandtricks)

I found this tip to be very useful for adding a “co” shortcut to Git…

Git Command Shortcuts (aliases) (evanjones.ca)
I’ve been using Mercurial to track my personal development projects. However, Git appears to be more popular, and I’ve needed to use it. The two are very similar, but my biggest annoyance is that Mercurial automatically completes commands using the characters you have typed, so hg st is a shortcut for hg status. Git does not do this by default, but you can add shortcuts with: git config –global alias.shortcut command. Example: git config –global alias.st status. This makes me very happy. See the git aliases documentation on the git wiki for details.