`find -exec` in git alias

This alias in .git/config:

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

Gives me this in the shell:

  • How can I delete a git alias?
  • How do you configure Github Desktop to run from the command line in OSX?
  • How to use bash variable correctly in gitconfig with alias
  • One GIT command to rule them all (gacp: git-add-commit-push)
  • How to reference remote repositories in a git alias?
  • What is the point of using git alias?
  • $ 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.

  • How to generate a git patch with a local commit
  • How to sync working directory with master directory, when somebody push change to our local system?
  • How do I prevent .git directory from getting copied to bin directory during rebuild?
  • rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C
  • How can I use git to provide a word count graph?
  • Should we ignore Solution Output folder while we are using Visual Studio and Version Control?
  • 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.