![](/img/trans.png)
[英]How can I have git ignore local changes to a specific file, without modifying the .gitignore?
[英]How can I reset a file ignore by git (not configured in .gitignore)?
查看被忽略的文件向我顯示:
git status-忽略
Untracked files:
(use "git add <file>..." to include in what will be committed)
.env
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
dist/
src/assets/icon/ui/wind1.svg
我的.gitignore只包含
dist
現在我想重置src / assets / icon / ui / *文件的忽略。 在哪里可以更改此忽略配置?
我的文件系統樹中只有一個.gitignore:
git ls-files '*.gitignore'
.gitignore
git check-ignore -v src/assets/icon/ui/wind1.svg
/Users/gerd/.config/git/ignore:9:Icon src/assets/icon/ui/wind1.svg
更改/Users/gerd/.config/git/ignore:9
注釋圖標排除模式。
細節:
您可以在每個子目錄中都有.gitignore
文件。
仔細檢查src
, src/assets
, src/assets/icon
和src/assets/icon/ui
,以確保在這些子文件夾之一中也沒有.gitignore
文件。
您還可以在項目目錄中運行命令git ls-files '*.gitignore'
列出所有.gitignore
文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.