threads / discuss / 44629

inconsistent output from git add about ignored files

Subject: inconsistent output from git add about ignored files

## tl;dr

One message between Dec 6, 2016 and Dec 6, 2016.

replies: 0people: 1as markdown or json

Yaroslav Halchenko· Dec 6, 2016, 14:18 UTC · lore
Dear Git gurus,

It seems that there is some inconsistency in output of git while it is ignoring files:

if a single path within ignored directory is provided -- git outputs the file path. If multiple files are provided (some of which aren't ignored) -- git outputs only the ignored directory name:

% git --version
git version 2.10.2
% git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	bu
nothing added to commit but untracked files present (use "git add" to track)
% cat .gitignore
*.me
% git add blah.me/bu
The following paths are ignored by one of your .gitignore files:
blah.me/bu
Use -f if you really want to add them.
% git add blah.me/bu bu
The following paths are ignored by one of your .gitignore files:
blah.me
Use -f if you really want to add them.
% git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
	new file:   bu

So note that in the first case it reports "blah.me/bu" whenever in the second -- only "blah.me".

P.S. Please CC us in your replies.
With best regards,
-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        

← back to recent threads