Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git ignore blank lines [duplicate]

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.

like image 510
boatcoder Avatar asked Jun 09 '26 11:06

boatcoder


1 Answers

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'

    Here --ignore-space-change can be abbreviated to -w.

    To use the alias: 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.

like image 109
yjqg6666 Avatar answered Jun 11 '26 02:06

yjqg6666