I have been using Git for basically all my personal projects lately and have found it to be exceedingly powerful. While the entire system is worth using simply for the content level tracking; the flexability of a fully distributed version control platform lends itself to thinking about software development entirely differently. That said, it takes a little configuring to get it working (the way I like) on all my development systems. Below is a random mash of links, config files, settings, and tips that I have had to re-reference while using git.
- gitolite – Hosting (and managing) your own git central server.. Done forget to ‘git push’ you changes when done.
- git Repos with gitolite – The gitolite people are not particularly… cuddly. This is an easier how-to for gitolite.
- git crash course – git for svn users.
- git cheat sheet – Huge list of misc. git commands, configuration information, usage, cloning, etc..
- git push origin master – The command I most often forget when push back from a cloned repository.
Here is my default ~/.gitignore file:
# Desktop Linux #
#################
.*
!.gitignore
*~
.directory# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip# Logs and databases #
######################
*.log# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
My primary git configuration settings look like this. The most useful parts are the alias (that not coincidentally look similar to SVN) and the colorized output.
color.ui=auto
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red bold
color.diff.new=green bold
color.status.added=yellow
color.status.changed=green
color.status.untracked=cyan
alias.st=status
alias.ci=commit
alias.br=branch
alias.co=commit
alias.df=diff
alias.dc=diff –cached
alias.lg=log -p
alias.lol=log –graph –decorate –pretty=oneline –abbrev-commit
alias.lola=log –graph –decorate –pretty=oneline –abbrev-commit –all
alias.ls=ls-files
Of course core.excludesfile, user.name, and user.email have to be set but they are depend on which system I am running on.