What are your favorite Git configuration settings which make your life easy while working with Git?
Asked
Active
Viewed 300 times
5
-
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 Answers
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.
-
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
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