1

I want to check trailing white space errors between two git commits and the following commands works fine for me:

git diff ${prev_commit_ID}..${current_commit_ID} --check --relative

Please help me to modify this command to exclude some file types such as *.txt, *.pl, *.groovy etc.

1 Answer 1

1
git diff ${prev_commit_ID}..${current_commit_ID} --check --relative -- . ':!*.txt' ':!*.pl' ':*.groovy'

. means all the files under the directory.

:!*.txt exclude .txt files.

Sign up to request clarification or add additional context in comments.

1 Comment

Maybe a little explanation would be useful, if you want to post a complete answer... you could also include a documentation link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.