At the last Women Who Code Lightening Talks, I presented "Cool Git Tricks (That I learn when things go badly)", a quick and cheeky intro to some very handy features that even experienced users are frequently unaware of. [SLIDES] [VIDEO]
Git information to your shell prompt?!
Many said their favorite trick was the custom shell prompt (see the slides for how great this is). They were awed that you can do that.
Me too. I'd first seen it in "McCullough and Berglund on Mastering Git", and had to know how the heck Matthew McCullough made his insaaaaane prompt. You've got to see it in action.
In fact, see the whole 5-hour video while you're at it. Great for anyone who's been banging their head against Git for a while. Earlier this year the team released a 4-hour followup to it, McCullough and Berglund on Mastering Advanced Git.
After seeing my Cool Git Tricks presentation, Chiu-Ki Chan was inspired to create her own Git prompt and showed code examples of what she'd done. Here's a Gist of the code for mine, while we're at it:
Have fun playing with the examples Chiu-Ki and I have given. Here's code for Matthew McCullough's Bash shell prompt too while we're at it.
Learning how to customize your prompt like this is a tantalizing preview of what Git's low-level "plumbing" makes possible.