[英]Why is my .gitignore file not ignoring the files I put into it?
這是在我的終端:
Changes to be committed:
(使用“git rm --cached ...”來取消演出)
new file: .getignore
new file: package-lock.json
new file: package.json
new file: public/help.html
new file: server.js
new file: views/about.hbs
new file: views/home.hbs
new file: views/maintenence.hbs
new file: views/partials/footer.hbs
new file: views/partials/header.hbs
未跟蹤文件:(使用“git add ...”包含將要提交的內容)
node_modules/
server.log
tests-MBP:node-web-server brettkessler $
這是我的.gitignore文件:
node_modules/
server.log
好像它根本沒有接受git ignore文件。 搜索周圍有人建議這樣做:
git rm -r --cached .
git add .
git commit -m "fixing .gitignore"
但這似乎對我沒有用.....任何人都知道我應該做什么?
您似乎拼寫錯誤的“.gitignore”為“.getignore”:
new file: .getignore
嘗試糾正這一點。
已提交的文件不會被“igonored”。 請刪除已提交的文件,提交並重試。
或者,如果您想要'igonore'已經提交的文件,您可以通過'update-index'命令執行此操作。 有關詳細信息,請參閱此處( https://git-scm.com/docs/git-update-index )。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.