簡體   English   中英

.gitignore 和未跟蹤的文件顯示在 git status 中

[英].gitignore and untracked files are shown in git status

我在使用 git 1.8.3.1 的 Centos 7.5.1804 上遇到了奇怪的情況。 我有.gitignore作為

*.pyc

git status顯示如下

$ 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

此外,這些文件從未提交過。 所以git status不應該顯示這些文件。 什么可能導致這種情況發生?

這是由於 .gitignore 文件中的拼寫錯誤,在*.pyc之后有額外的空間。 但是,使用git 2.7. Ubuntu 16.04.5上的行為有所不同git 2.7. 4 即使有額外的空間,也沒有列出文件。

可能在git 1.8.3.12.7.4之間已經解決了這個空間問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM