.gitignore和未跟踪的文件以git状态显示

时间:2019-06-15 21:01:44

标签: git gitignore git-status git-untracked

我在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 不应该显示这些文件。什么会导致这种情况发生?

1 个答案:

答案 0 :(得分:1)

这是由于.gitignore文件中的错字引起的,*.pyc后有多余的空格。但是,Ubuntu 16.04.5git 2.7. 4在git 1.8.3.1上的行为有所不同,即使有额外的空间,文件也不会列出。

此空间问题可能是在2.7.4Sub Increment_My_File() Dim myfile As String, mypath As String, mycount As Integer, _ mydate As String, wb as Workbook mydate = Format(Now(), "MM-DD-YYYY") mypath = "C:\Users\reggie\OneDrive\Documents\" Set wb = Workbooks.Add 'and do some code Do mycount = mycount + 1 myfile = mypath & "Account Breakdown " & mydate & " #" & mycount _ & " Inventory Allocation.xlsx" 'Dir '<<<this would return the next file name in the folder. Not what you are trying to do Loop Until Dir(myfile) = "" wb.SaveAs Filename:=myfile End Sub 之间解决的。