Last active
November 8, 2020 07:50
-
-
Save zthxxx/153bdcc241300b0adc666f0b3222af85 to your computer and use it in GitHub Desktop.
auto ignore console.log at git diff or stage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitattributes or .git/info/attributes | |
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreattributesFile | |
*.[jt]s filter=ignoreLogStage | |
*.[jt]sx filter=ignoreLogStage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://git-scm.com/docs/gitattributes | |
# enable this config via the command below | |
# git config include.path ../.gitconfig | |
# https://stackoverflow.com/questions/6557467/can-git-ignore-a-specific-line/16244817#16244817 | |
# git filter workflow: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_keyword_expansion | |
[filter "ignoreLogStage"] | |
# set `*.[jt]s filter=ignoreLogStage` in .gitattributes | |
# ignore log code generated by https://github.com/Chakroun-Anas/turbo-console-log | |
# git config filter.ignoreLogStage.clean 'perl -ne "print unless /^[\t ]*\/* ?console\.log\(.TCL: /"' | |
clean = perl -ne \"print unless /^[\\t ]*\\/* ?console\\.log\\(.TCL: /\" | |
smudge = cat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment