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

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

From
ARAlexandre Remy <alexandre.remy.contact@gmail.com>
Date
May 13, 2021, 08:05 UTC
Message-ID
<CAKToE5DgtW1Kuw4AE5+Am_=9gATN-S=xk1kYXMZUWvtdtNy_PQ@mail.gmail.com>
In-Reply-To
<81d06db6-fd91-7ec5-6aa5-84f69a227204@kdbg.org>

Thank you, that was that. I was misled by the doc and the single-quote which indeed is specific to the linux platform.

Thank you again for your prompt reply.
Le jeu. 13 mai 2021 à 09:49, Johannes Sixt <j6t@kdbg.org> a écrit :
Show 35 quoted lines
>
> Am 13.05.21 um 08:57 schrieb Alexandre Remy:
> > 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).
>
> Which shell did you use to invoke the Windows version? If it was from
> CMD or PowerShell, then you must not put the name in single-quotes:
>
>    git status -- src/test.js
>
> The reason is that the single-quote does not have a special meaning for
> CMD and PowerShell like it does for a POSIX shell.
>
> -- Hannes
Previous: Johannes SixtNext: Alexandre Remy
Message 3 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.