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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an additional question, does double-quotes be safely used in
both windows (that's ok) and linux shell  for pathspecs (git status --
"src/test.js") in case of spaces in the path?

Le jeu. 13 mai 2021 à 10:05, Alexandre Remy
<alexandre.remy.contact@xxxxxxxxx> a écrit :
>
> 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@xxxxxxxx> a écrit :
> >
> > 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux