orlp
orlp

Reputation: 117681

gitignore'd file keeps getting listed as untracked

I have a directory listing that looks like this (this is the root of my repo):

.git
.gitignore
MORE FILES / FOLDERS
_viminfo

My .gitignore looks like this:

/_viminfo

Everything, including the .gitignore, has been long commited and everything. However, when I type git status I still get this output:

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       _viminfo

What could be the culprit of this?

Upvotes: 1

Views: 166

Answers (2)

orlp
orlp

Reputation: 117681

There was a trailing space after /_viminfo in the .gitignore, removing it fixed the problem.

Upvotes: 2

Billy Moon
Billy Moon

Reputation: 58531

Try...

./_viminfo

or to remove from whole project...

_viminfo

and make sure there are no trailing spaces after the filenames ;)

Upvotes: 2

Related Questions