英文:
KevinCookieCompany: .gitignore is not ignoring .txt file on Mac
问题
已创建.gitignore文件并保存为纯文本文档。
# 忽略所有.txt文件
*.txt
当我在终端中运行git status
时,文件"Employee Salaries.txt"仍然显示。
分支:main
尚未提交的更改:
(使用"git add <文件>..."将其包含在即将提交的内容中)
- .DS_Store
- .gitignore.txt
- Employee Salaries.txt
- KCC Logo.png
- index.htm
- secret recipe.htm
照片显示了文件的状态,所有文件都显示为红色且未提交。
我以为也许.gitignore文件需要另一种格式。将其从.txt文件更改为.rtf文件,但没有任何区别。在Finder中它显示为.gitignore。
英文:
Created .gitignore in TextEdit and saved as plain text document.
(hashtag) ignore all .txt files
*.txt
When I check git status in terminal the file Employee Salaries.txt still shows up.
On branch main
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
.gitignore.txt
Employee Salaries.txt
KCC Logo.png
index.htm
secret recipe.htm
[Photo of how it looks](https://i.stack.imgur.com/feniL.png)
The files are all in red and not commited.
Thought maybe .gitignore file needed another format. Changed it from a .txt file to a .rtf file. Did not make a difference. In Finder it shows as .gitignore
[Photo of how its saved]1
答案1
得分: 0
将.gitignore.rtf
重命名为.gitignore
。
英文:
Rename .gitignore.rtf
to just .gitignore
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论