I often use in the preparation of Z Shell file
set -x
to open debugging, but do not want to submit to the warehouse
solution
Git provides a file filters, this method can help remove when submitting set -x
us first to write a script, how to remove this line.
That the use ofsed "/^set -x$/d"
To filter a name, here to "DebugShell" for example. Add Filter
git config --local filter.DebugShell.clean 'sed "/^set -x$/d"'
git config --local filter.DebugShell. smudge 'sed "/^set -x$/d"'
Modifying .gitattributes
the file, using the filter for a particular file.
*.zsh filter=DebugShell