Instalei o Git for Windows com a opção "substituir comandos nativos" marcada. Eu verifiquei meu caminho:
C:\Users\Domenic>echo %PATH%
C:\Program Files\Git\usr\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Windows\system32;C:\Windows;C:\python2;C:\python2\Scripts;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\GitExtensions\;C:\Program Files\LLVM\bin;C:\depot_tools;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Ruby21-x64\bin;C:\ProgramData\nodist\bin;C:\ruby200\bin;C:\Chocolatey\bin;C:\Program Files\kdiff3;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\Docker Toolbox;C:\Users\Domenic\AppData\Roaming\npm;C:\Users\Domenic\Dropbox\PATH
(se você não quiser rolar muito, apenas observe que C:\Program Files\Git\usr\bin
é o primeiro)
Eu verifiquei com where
:
C:\Users\Domenic>where mkdir
C:\Program Files\Git\usr\bin\mkdir.exe
E quando eu corro isso diretamente, funciona muito bem:
C:\Users\Domenic>"C:\Program Files\Git\usr\bin\mkdir.exe" --help
Usage: /usr/bin/mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask
(... etc ...)
No entanto, quando tento executar mkdir
a partir da linha de comando, ele sempre volta para o código interno do Windows:
C:\Users\Domenic>mkdir --help
A subdirectory or file --help already exists.
C:\Users\Domenic>mkdir /?
Creates a directory.
MKDIR [drive:]path
(... etc ...)
Por que não posso substituir o mkdir?
Windows 10, Git para Windows 2.7.3
Tags command-line windows git