【问题标题】:How do you add .gitignore to staging when using git add --all使用 git add --all 时如何将 .gitignore 添加到暂存中
【发布时间】:2017-02-23 01:49:21
【问题描述】:

使用 git add --all 时,.gitignore 不会添加到暂存中。那么我尝试像这样手动添加.gitignore

$ git add .gitignore
The following paths are ignored by one of your .gitignore files:
.gitignore
Use -f if you really want to add them.

所以我必须使用 -f 来强制添加 .gitignore,这很烦人

【问题讨论】:

标签: git


【解决方案1】:

.gitignore 文件中删除.gitignore 条目。

【讨论】:

  • .gitignore 不在 .gitignore 中。只是 Pods/ 用于 iOS 项目
  • @MichaelL .gitignore 在某个 .gitignore 文件中。您可以运行 git check-ignore -v .gitignore 以查看哪个 .gitignore 文件忽略了该 .gitignore 文件。
猜你喜欢
  • 1970-01-01
  • 2011-09-30
  • 1970-01-01
  • 2016-11-12
  • 2019-04-16
  • 2014-05-25
  • 2016-02-14
  • 1970-01-01
  • 2016-03-27
相关资源
最近更新 更多