Telling git to ignore symlinks

后端 未结 8 1961
说谎
说谎 2020-12-08 06:13

This question has appeared in similar forms here and here, but they don\'t seem to match up with what I\'m looking for.

I\'m making a project in StaticMatic, a Ruby

8条回答
  •  無奈伤痛
    2020-12-08 06:55

    If you really want to ignore a filename if it's a symlink or file but not if it is a directory, you can add to .gitignore :

    /media
    !/media/
    

    To formulate it like @Chris_Rasys, this will :

    • Ignore - (symlink) ./media
    • Ignore - (file) ./media
    • Do not ignore - (directory) ./media
    • Do not ignore - ./something/media
    • Do not ignore - ./media.bak
    • Do not ignore - ./media-somethingelse

提交回复
热议问题