Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

config - How to make git diff --ignore-space-change the default

I could probably setup an alias, but it seems like I should be able to set this as an option in the config file, only I don't see anyway to do it.

I only want the --ignore-space-change when I'm doing diff, not when I'm doing apply or anything else. I'm trying to make the diff easier to understand by not cluttering it with with extraneous +/- lines that have no real changes on them.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could use git alias or bash alias if you are using shell-available OS.

  1. git alias : Run this command to add alias:

    git config --global alias.dfw 'diff --ignore-space-change'

    --ignore-space-change can be abbreviated to -w
    to apply the alias using: git dfw

  2. bash alias : Run this command to add bash alias:

    echo "alias gitdfw='git diff --ignore-space-change'">>~/.profile

    Open a new terminal and you can directly run gitdfw to achieve the same.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...