To automatically remove whitespace from all your files, add this to your text editor’s configuration file.

General syntax:


autocmd BufWritePre <filetype> :%s/\s\+$//e

I use vim, so I add this to my ~/.vimrc file


autocmd BufWritePre *.page :%s/\s\+$//e

That automatically removes all whitespaces when I save a file with :w

Also, you can check the diff of all new commits to be pushed to master with


git diff origin/branch-name

Some examples:


git diff origin/mallard-help


git diff origin/master

Advertisements