开发者

What are some of your favorite settings in Git configuration files to make Git Fun? [closed]

开发者 https://www.devze.com 2022-12-22 06:52 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 2 years ago.

开发者_如何转开发 Improve this question

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


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.


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.


I use:

[color]
    ui = auto

It makes diffs and things pretty. :-)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消