git/list[1] front-page[2] threads[3] people[4] search[5] about
 

inconsistent output from git add about ignored files

From
Yaroslav Halchenko <yoh@onerussian.com>
Date
Dec 6, 2016, 14:18 UTC
Message-ID
<20161206141818.g5qxjt5wq2xbpkth@hopa.kiewit.dartmouth.edu>
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        
Message 1 of 1 in “inconsistent output from git add about ignored files”
  1. Yaroslav HalchenkoDec 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.