From: Christian Neukirchen Date: Tue, 31 May 2016 15:59:45 GMT Subject: Re: git add without whitespace Message-ID: <87pos2tdzi.fsf@gmail.com> In-Reply-To: Junio C Hamano writes: > Robert Dailey writes: > >> $ git diff -U0 -w --no-color | git apply --cached --ignore-whitespace >> --unidiff-zero >> >> This command explicitly leaves out context because it can sometimes >> cause the patch to fail to apply, I think due to whitespace being in >> it, but I'm not completely sure myself. > > I have had this in my ~/.gitconfig for a long time. > > [alias] > wsadd = "!sh -c 'git diff -- \"$@\" | git apply --cached --whitespace=fix;\ > git co -- ${1-.} \"$@\"' -" Very useful, thanks for sharing! I wonder which other gems are in your .gitconfig, is it public? -- Christian Neukirchen http://chneukirchen.org