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

Git pathspecs difference in behavior between linux (wsl) and windows

From
ARAlexandre Remy <alexandre.remy.contact@gmail.com>
Date
May 13, 2021, 06:57 UTC
Message-ID
<CAKToE5BnzXd_2pjhJY13E=e6b1ZgOV=NmXr_WfpCQd+LxXsO3A@mail.gmail.com>
Hi,

I do not understand why the same command works on linux and not on windows. Is the pathspecs syntax differ or there is a problem on the git windows version?

* On windows (git version 2.31.1.windows.1)

git status -- 'src/test.js' On branch master nothing to commit, working tree clean

* On linux (wsl: git version 2.25.1)
git status -- 'src/test.js'
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   src/test.js
A classic git status gives the same result between linux and windows
(with correct file detected).
Regards,
Next: Johannes Sixt
Message 1 of 8 in “Git pathspecs difference in behavior between linux (wsl) and windows”
  1. Alexandre RemyMay 13, 2021
  2. Johannes SixtMay 13, 2021
  3. Alexandre RemyMay 13, 2021
  4. Alexandre RemyMay 13, 2021
  5. Johannes SixtMay 13, 2021
  6. Junio C HamanoMay 13, 2021
  7. Johannes SixtMay 13, 2021
  8. Alexandre RemyMay 13, 2021

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.