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

(unknown)

From
Mmail@glenstark.net <mail@glenstark.net>
Date
Aug 26, 2014, 11:16 UTC
Message-ID
<e1b2b0f6c0bdf4585f8e14ebacd68937.squirrel@webmail.glenstark.net>
Hi everyone.

Normally if I am tracking a file in a Directory which satisfies one of my .gitignore rules, I can just add them via "git add foo", and I have no issues.

For example, let me create a new repo. I create a directory "lib" containing file "foo.txt", and a Directory "lib2" with a file "bar.txt". I add and commit both files.

Now I create a .gitignore file containing the rule "lib*/". I modify lib/foo.txt and lib2/bar.txt. I do "git status" and I'm informed that foo.txt and bar.txt are modified. So far so good.

The following commands work as expected:
 git add lib/foo.txt
 git add lib2/bar.txt
But if I instead do:
  git add lib/foo.txt lib2/bar.txt
I get the following response:
  The following paths are ignored by one of your .gitignore files:
  lib
  lib2

I have verified this behavior in git 1.9.3 and 2.1.0. Is this desired behavior or is it a bug? If it is desired behavior, could someone please describe the utility to me?

Many thanks for your excellent work
Glen Stark
Message 1 of 1 in “(unknown)”
  1. mail@glenstark.netAug 26, 2014

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.