我有一个包含以下行的开源项目的 .gitignore
文件:
*~
这行 - 星号后跟波浪号 - 在 .gitignore
文件的上下文中是什么意思?
我试过谷歌搜索但无济于事。
最佳答案
参见 https://git-scm.com/docs/gitignore “模式格式”部分,在这种情况下:
If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file).
所以它会忽略所有名称以波浪号结尾的文件。
关于Gitignore 星号代字号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36478324/