git - .gitignore and untracked files are shown in git status
问题描述
I am getting wierd scenario on Centos 7.5.1804 with git 1.8.3.1.
I have .gitignore
as
*.pyc
but git status
showing following
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# a.pyc
# b.pyc
# c.pyc
# d.pyc
Also, those files have never been committed. So git status should not have shown those files. What could cause this to happen?
解决方案
This was due to a typo in the .gitignore file which had extra space after *.pyc
. However, the behaviour was different on Ubuntu 16.04.5
with git 2.7.
4 where the files were not listed even with extra space.
Probably this space issue has been taken cared between git 1.8.3.1
and 2.7.4
.
推荐阅读
- documentation - JSON RPC 文档工具
- java - 如何获取 compundDrawable 的运行时宽度和高度
- ssl - NGINX,在同一个 server_name 上设置多个证书
- android - Android 4.4 Kit Kat 上的 React Native [错误:无法加载包]
- php - 在 Laravel 中获取单数形式的同形异义词
- django - 在 DJANGO 自动生成的 id 中使用 CYCLE postgres 序列属性
- excel - SpreadsheetLight 获取以撇号开头的 excel 单元格值
- c# - 不使用工具查看 HttpWebRequest 的内容(C#)
- jquery - 我有这样的代码:我的下拉按钮应该反映我在输入文本字段中输入的数据
- mediawiki - 在维基媒体模板中使用 OSM 标签