Does git support wildcards in paths?

后端 未结 4 517
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 14:41

I have looked, searched, and read documentation and can\'t really find anything about this.

Basically, I want to be able to do this:

git reset -- *.exe
<         


        
4条回答
  •  萌比男神i
    2021-02-01 15:41

    Git does support some pathspec globbing, but you need to be careful to shell-escape the characters so they aren't interpreted by in your case, msys bash, which doesn't support more sophisticated wildcard expansion.

    EDIT: Also, for your reset example, you can just pass the directory as an argument to git reset and git will operate recursively.

    git reset my/long/path
    

    rather than

    git reset my/long/path/*
    

提交回复
热议问题