ignoring any 'bin' directory on a git project

前端 未结 15 1818
暖寄归人
暖寄归人 2020-11-22 16:45

I have a directory structure like this:

.git/
.gitignore
main/
  ...
tools/
  ...
...

Inside main and tools, and any other directory, at an

15条回答
  •  遥遥无期
    2020-11-22 17:21

    If the pattern inside .gitignore ends with a slash /, it will only find a match with a directory.

    In other words, bin/ will match a directory bin and paths underneath it, but will not match a regular file or a symbolic link bin.


    If the pattern does not contain a slash, like in bin Git treats it as a shell glob pattern (greedy). So best would be to use simple /bin.

    bin would not be the best solution for this particular problem.

提交回复
热议问题