Sunday, 16 June 2013

git configuration on a new machine

Whenever I start using a new machine for development these are the first options I setup.

First things first - Your name

git config --global "Andrea Salvadore"
git config --global ""

Better log messages

git config --global alias.lg "log --color --graph 
  -%C(yellow)%d%Creset %s %Cgreen(%cr) 
  %C(bold blue)<%an>%Creset' 
This command will generate nicely coloured and formatted git logs. See more details in here

Some common aliases

git config --global status
git config --global

merge tool

I use diffmerge or meld. The following configuration is for diffmerge
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.trustexitcode true
git config --global mergetool.keepbackup false
git config --global mergetool.diffmerge.cmd
  "/usr/bin/diffmerge --merge
  --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\""

diff tool

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd diffmerge '$LOCAL' '$REMOTE'

push current folder

git config --global push.default current
This will allow you to type
git push origin
instead of
git push origin <current_branch_name>

Tell git to ignore file permission changes

git config --global core.filemode false

No comments: