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

git-add says 'pathspec did not match any files' for git repository in /

From
Matthijs Kooijman <matthijs@stdin.nl>
Date
Mar 25, 2011, 10:02 UTC
Message-ID
<20110325100254.GH30350@login.drsnuggles.stderr.nl>
Hey folks,

I've been using git for keeping config files using a repository in /. In 1.7.4.1, this seems to be broken again. Committing, diffing and status work this time, but git add gives a pathspec did not match any files error when adding a file while the current working directory is not /.

This is best illustrated by an example:

root@ldap:/# git init Initialized empty Git repository in /.git/ root@ldap:/# cd etc/ root@ldap:/etc# gt add fstab bash: gt: command not found root@ldap:/etc# git add fstab fatal: pathspec 'fstab' did not match any files root@ldap:/etc# ls -l fstab -rw-r--r-- 1 root root 37 Mar 24 16:58 fstab root@ldap:/etc# cd / root@ldap:/# git add /etc/fstab root@ldap:/etc# git --version git version 1.7.4.1

All of this worked properly in 1.7.1. There was a different problem in 1.7.2, but that was fixed then (and with that fix, the above problem didn't occur). I haven't tested 1.7.3.

I don't have time to fix this right now, so I'll be sticking to 1.7.1 for now. Perhaps someone else want to look into this.

Gr.
Matthijs
Next: Nguyen Thai Ngoc Duy
Message 1 of 7 in “git-add says 'pathspec did not match any files' for git repository in /”
  1. Matthijs KooijmanMar 25, 2011
  2. Nguyen Thai Ngoc DuyMar 25, 2011
  3. setup: return correct prefix if worktree is '/'Nguyễn Thái Ngọc Duy, Mar 25, 2011
  4. Michael J GruberMar 25, 2011
  5. Nguyen Thai Ngoc DuyMar 25, 2011
  6. dir.c: do not trip over difference in "/"Michael J Gruber, Mar 25, 2011
  7. Nguyen Thai Ngoc DuyMar 26, 2011

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.