Is there a way to use wildcards with git checkout?

前端 未结 8 898
遇见更好的自我
遇见更好的自我 2020-12-24 00:40

What I would like to do is to checkout a single file or a set of files with a common name part like this

git checkout myBranch */myFile.md and

<

8条回答
  •  感情败类
    2020-12-24 01:02

    Git does not deal with the wildcard, but your shell does.

    Try this :

    git checkout myBranch **/myFile.md
    

    and

    git checkout myBranch  **/*Test*
    

    With the **, your shell will look for files in all the subdirectories starting from the current working directory.

提交回复
热议问题