I have a filter set up to clean certain pieces of metadata and output from a Jupyter Notebook in a git repository. I came across a situation where I wanted to temporarily bypass the filter for a single stage -> commit sequence, and I am wondering if there there is a way to do this more generally (maybe an option in git add
or git commit
that bypasses the filter?)
I am looking for either a simple way to do this or an explanation of why it is not possible.
Here is what I have considered so far:
git add --renormalize
... does the opposite of what I want to do- Disable git clean filter for checkout and stash pop: this question discusses how the clean filter relates to
checkout
and other git commands, but not theadd
tocommit
workflow.
As the clean and smudge commands of a filter driver are specified in configuration files, we can pass temporary values to the variables to overwrite values from configuration files with the help of -c <name>=<value>.
foo
could be empty or maybecat
, so that the file content is unchanged. If you have multiple drivers, use multiple temporary values to disable them all.