KevinCookieCompany: .gitignore在Mac上没有忽略.txt文件

huangapple go评论65阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月7日 17:30:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75660144.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定