Git gets me good
Ok I am now fully on board with the Git crew. I now understand how Git works into my natural work flow. I finally rounded the corner of thinking of it as a one for one replacement of another SCM. I believe it may be clearer to start using Git without previous experience with Subversion or CVS. So I would recommend going in to learning Git without thinking to much about other Version Control Software.
A few simple things helped me immensely in learning to use Git everyday.
Git branch name in your command prompt
Since multiple branches are managed in the same directory on your local machine, a common question you ask is what branch am I working on. similar to what directory am I in. This bit of information is very valuable, so why not put it right in your command prompt. I can’t imagine working with Git and not having this. It puts all the important information in front of you so you know exactly what you are working with.
function parse_git_branch {
git branch --no-color 2> /dev/null \
| sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\h \w\$(parse_git_branch) \n[\u] > "
Auto-complete for Git
Working without autocomplete is like working blind or maybe just without glasses. This script makes the TAB button work for you and for Git. Add .git-completion.bash to your .??rc file and you will be set to go.
gitk OR GitX (for Mac OSX)
At some point you will get to a branch/merge/rebase situation that you just can figure out. Pop open one of these beauties and the visual keys are usually enough to help you understand WTF is going on and how to fix it. I can’t count the number of times that these beauties have saved me from going cross eyed.
I am working on releasing my dotfiles so checkout the project to see some more things I tried.