5

What are your favorite Git configuration settings which make your life easy while working with Git?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Rachel
  • 100,387
  • 116
  • 269
  • 365
  • Any more tips & tricks with Git Configuraton ? – Rachel Mar 06 '10 at 17:18
  • @Sure: in the meantime, you can also define your own config default setting here: http://stackoverflow.com/questions/2093077/default-config-settings-for-a-new-git-repository – VonC Mar 06 '10 at 18:22

4 Answers4

5

Best one I have was picked up off Scott Chacon from a talk he gave:

[alias]
    lol = log --pretty=oneline --abbrev-commit --graph --decorate

I get excited every time I type git lol.

csexton
  • 24,061
  • 15
  • 54
  • 57
4

The aliases I mention in Trimming GIT Checkins (and the fixup! action from the recent Git1.7.0):

[alias]
    fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
    squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' 

, really help me to commit very often even though I am in the middle of one task, allowing me to finish it with one coherent commit at the end (instead of too many small intermediate commits).
Not exactly "fun", but very useful.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Depending on how you're using this, you can probably get the same effect with `git commit (--fixup|--squash) $commit` – Max Nanasy Mar 08 '13 at 07:36
3

I use:

[color]
    ui = auto

It makes diffs and things pretty. :-)

Daniel Stutzbach
  • 74,198
  • 17
  • 88
  • 77
0
alias gs='git status'
alias ga='git add .'
alias gc='git commit -m'

This is 80% of the typing I do in git on any given day. I know I can combine the last two aliases with the -am flag, but it's nice to have the separated, that way I can check the status of the index before I commit.

kubi
  • 48,104
  • 19
  • 94
  • 118