[英]how to ignore a file using .gitignore
我刪除了一個文件path/to/the/file.cpp
,這是git存儲庫頂部的相對路徑,但我希望git status
忽略該文件。
嘗試將以下模式放入.gitignore
文件中,但似乎它們都.gitignore
。
**/file.cpp
file.cpp
path/to/the/file.cpp
有任何想法嗎? 謝謝。
這是你必須要做的
git rm path/to/the/file.cpp
現在當你的git忽略應該工作
的.gitignore
path/to/the/file.cpp
正如Matti Virkkunen指出的那樣,您的文件必須已經被git跟蹤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.