Unix wildcard selectors? (Asterisks)

后端 未结 3 1041
清歌不尽
清歌不尽 2020-12-30 00:46

In Ryan Bates\' Railscast about git, his .gitignore file contains the following line:

tmp/**/*

What is the purpose of using the double

3条回答
  •  有刺的猬
    2020-12-30 01:04

    From http://blog.privateergroup.com/2010/03/gitignore-file-for-android-development/:

    (kwoods)

    "The double asterisk (**) is not a git thing per say, it’s really a linux / Mac shell thing.
    
    It would match on everything including any sub folders that had been created.
    
    You can see the effect in the shell like so:
    
    # ls ./tmp/* = should show you the contents of ./tmp (files and folders)
    # ls ./tmp/** = same as above, but it would also go into each sub-folder and show the contents there as well."
    

提交回复
热议问题