git ignore specific file in subdirectory

时间:2018-06-04 17:38:38

标签: git

I have a .gitignore file in the root of a git repository on my Windows machine and I'd like to ignore a specific file located in a subdirectory (several levels down from the root). Is this how I specify the file I want to ignore in .gitignore?

path/to/file/myignoredfile.txt

1 个答案:

答案 0 :(得分:0)

/path/to/file/myignoredfile.txt
确切地说,是的。请注意最初的斜线。这意味着“从这个.gitignore所在的目录开始遍历”。