git: How do I recursively add all files in a directory subtree that match a glob pattern?

后端 未结 6 1983
谎友^
谎友^ 2021-01-31 14:15

I have several .screen files inside /xxx/documentation and its subdirectories that are already tracked by Git.

After modifying many of these screen files, I

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 14:41

    It's a bug in the documentation. Quote the asterisk with

    $ git add documentation/\*.screen

    or

    $ git add 'documentation/*.screen'

    to get the behavior you want.

    If instead you want to add files in the current directory only, use

    $ git add *.screen

    UPDATE: I submitted a patch that corrects the issue, now fixed as of version 1.6.6.2.

提交回复
热议问题