git ignoring .gitattributes pattern

后端 未结 7 2136
夕颜
夕颜 2020-12-16 20:45

I\'ve a directory structure like this:

root/
  .git
  deploy/
  Site/
    blah/
    more_blah/
      something.local
      else.development
    Rakefile
             


        
7条回答
  •  醉酒成梦
    2020-12-16 21:33

    If you want git to ignore a file put it in the .gitignore file not the .attributes file.

    If you want to ignore your Rakefile put the following in the .gitignore file at the root of your project.

    /**/Rakefile
    

    Specify the full path if you have more than one and you only want to ignore one of them.

    A few examples of how to implement pattern matching for these files:

    For All Files in All Folders
    /**/*.ext
    
    For A File in All Folders
    /**/some_file.ext
    
    File in Root Folder
    /some_file.ext
    
    File in A Folder
    /some_folder/some_file.ext
    
    All Files in A Folder
    /some_folder/*
    

提交回复
热议问题