git ignoring .gitattributes pattern

后端 未结 7 2089
夕颜
夕颜 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:48

    With git version 1.7.2.5, which is the default on debian squeeze (hence this post), there must not be a slash at the end to ignore a directory. So in order to ignore the deploy dir in the above question the following line must be used (no slash):

    deploy        export-ignore
    

    This is in contradiction to the documentation (man gitattributes / man gitignore) and the git book. The documentation of gitattributes references gitignore. Interestingly dirs with a slash (deploy/) work in a .gitignore file.

    I did not test later versions of git.

提交回复
热议问题