Skip to content

MinGit CLI not working if installation path is longer than 132 characters #1764

@thenlich

Description

@thenlich
  • [v] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    64-bit (MinGit-2.18.0-64-bit)
$ git --version --build-options
git version 2.18.0.windows.1
cpu: x86_64
built from commit: cd1a74fc9dc8a07626c216940db9a51f25206e03
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    Windows Version 10.0.15063 Build 15063 (64-bit)
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.15063]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
    none
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** insert your machine's response here **
n/a
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

The installation path is 133 characters long (C:\Temp\am_Files__x86__Microsoft_Visual_Studio_2017_WDExpress_Common7_IDE_CommonExtensions_Microsoft_TeamFoundation_Team_Explorer_Git)

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

setlocal
set DIR2=C:\Temp\am_Files__x86__Microsoft_Visual_Studio_2017_WDExpress_Common7_IDE_CommonExtensions_Microsoft_TeamFoundation_Team_Explorer_Git
"C:\Program Files\7-Zip\7z.exe" -o%DIR2% x MinGit-2.18.0-64-bit.zip

cd /d c:\temp
mkdir test.git
mkdir remote.git

set PATH=%DIR2%\cmd
git --version --build-options

git init test.git
git --bare init remote.git
cd test.git
git config user.email [email protected]
git config user.name Test

git remote add origin c:\temp\remote.git
echo > test.c
git add .
git commit -m TestMessage
git push origin master
  • What did you expect to occur after running these commands?
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 234 bytes | 117.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To c:\temp\remote.git
 * [new branch]      master -> master

  • What actually happened instead?
error: cannot spawn sh: No such file or directory
fatal: unable to fork

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

n/a

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions