Search code examples
bashgitlinediffignore

Ignore first three lines & ignore lines with marks


In git bash

  • How to ignore the first three lines during git diff between the working directory and repo?
  • How to ignore any differences for all lines begin with an exclamation mark!

Many thanks in advance


Solution

  • You can pipe the relevant commands:

    git diff | tail -n +3 | grep -v "^!"