`find -exec` in git alias

This alias in .git/config:

pycat = !find -iname '*.py' -exec cat {} \;

Gives me this in the shell:

  • Any reason to use a Git alias instead of a git-* script?
  • git alias to delete local and remote
  • Can git know which branch your current branch was branched from?
  • One GIT command to rule them all (gacp: git-add-commit-push)
  • AWK statement inside a git alias
  • git alias for recent checkout branches
  • $ git pycat
    fatal: bad config file line 19 in .git/config
    

    I’ve tried quotes, no quotes, switching quote types, escaping everything up to four levels, but I can’t figure out what’s making git unhappy here.

  • Git summary of files -> times changed in last month
  • Way to search source in Gitolite repos?
  • git file difference from commit to a branch
  • Use of an exclamation mark in a Git commit message via command line?
  • Heroku automatic push to github with submodules
  • Git has stop working on windows 10 (git version 2.7.0 and git version 2.6.x)
  • One Solution collect form web for “`find -exec` in git alias”

    A little farting around says it’s the semicolon,

    pycat = !find -iname '*.py' -exec cat {} "\\;"
    pycat = !find -iname '*.py' -exec cat {} "';'"
    pycat = "!find -iname '*.py' -exec cat {} \\;"
    pycat = "!find -iname '*.py' -exec cat {} \";\""
    

    all work. Semicolons are old-school comment-to-eol syntax, that may be what’s going on here. So the config parser’s eating one layer of doublequotes.

    (edit: yup. It even says so in the doc:

    The syntax is fairly flexible and permissive; whitespaces are mostly ignored. The # and ; characters begin comments to the end of line, blank lines are ignored.

    )

    Git Baby is a git and github fan, let's start git clone.