Repository navigation
Git clone from local folder broken? #5469
Copy link
Copy link
Open
Description
Im not able to clone a local git repo to an other folder:
PS C:\> $env:GIT_TRACE=1
PS C:\> git clone -v C:\template\ foo
21:03:17.531368 exec-cmd.c:266 trace: resolved executable dir: C:/mingit/mingw64/bin
21:03:17.547014 git.c:476 trace: built-in: git clone -v 'C:\template\' foo
Cloning into 'foo'...
21:03:17.547014 run-command.c:668 trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 'git-upload-pack '\''C:\template\/.git'\'''
21:03:17.562719 run-command.c:929 trace: start_command: C:/mingit/mingw64/bin/busybox.exe -c 'git-upload-pack '\''C:\template\/.git'\''' 'git-upload-pack '\''C:\template\/.git'\'''
-c: applet not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Here is how i installed it
echo $PSVersionTable
$ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $('https://github.com/git-for-windows/git/releases/download/v2.48.1.windows.1/MinGit-2.48.1-busybox-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) -OutFile 'mingit.zip' -UseBasicParsing
Expand-Archive mingit.zip -DestinationPath c:\mingit
Remove-Item mingit.zip -Force
$env:Path += ";c:\mingit\cmd"
Seems similar to #5121
cloning a remote repo seems to work fine
PS C:\> git clone https://github.com/git-for-windows/git.git
21:09:19.793756 exec-cmd.c:266 trace: resolved executable dir: C:/mingit/mingw64/bin
21:09:19.793756 git.c:476 trace: built-in: git clone https://github.com/git-for-windows/git.git
Cloning into 'git'...
21:09:19.809389 run-command.c:668 trace: run_command: git remote-https origin https://github.com/git-for-windows/git.git
21:09:19.809389 run-command.c:929 trace: start_command: git remote-https origin https://github.com/git-for-windows/git.git
21:09:19.825014 exec-cmd.c:266 trace: resolved executable dir: C:/mingit/mingw64/bin
21:09:19.825014 git.c:771 trace: exec: git-remote-https origin https://github.com/git-for-windows/git.git
21:09:19.825014 run-command.c:668 trace: run_command: git-remote-https origin https://github.com/git-for-windows/git.git
21:09:19.825014 run-command.c:929 trace: start_command: git-remote-https origin https://github.com/git-for-windows/git.git
21:09:19.840640 exec-cmd.c:266 trace: resolved executable dir: C:/mingit/mingw64/bin
21:09:21.207576 run-command.c:668 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 720 on 953b78ed75f6' --check-self-contained-and-connected
21:09:21.207576 run-command.c:929 trace: start_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 720 on 953b78ed75f6' --check-self-contained-and-connected
21:09:21.223055 exec-cmd.c:266 trace: resolved executable dir: C:/mingit/mingw64/bin
21:09:21.223055 git.c:476 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 720 on 953b78ed75f6' --check-self-contained-and-connected
remote: Enumerating objects: 642327, done.
remote: Counting objects: 100% (3485/3485), done.
remote: Compressing objects: 100% (1387/1387), done.
remote: Total 642327 (delta 2818), reused 2124 (delta 2098), pack-reused 638842 (from 3)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
dscho commentedon Mar 5, 2025
This is MinGit-busybox, isn't it? Can you use regular MinGit instead?
fliiiix commentedon Mar 6, 2025
I realized that as well and i will try the regular MinGit
and update the issue here when i have results👍It is in fact a busybox only issue, works fine with the regular version
Chanchal-Cyber commentedon Mar 20, 2025
karen-arutyunov commentedon Apr 13, 2026
Are there any plans to fix this issue?
It feels like integration with BusyBox is pretty much broken at the moment.
For example, running
git ls-remote <local-repo>fails with the same error.I'm using MinGit-2.53.0.2-busybox-64-bit.zip in CMD.
Also, since we currently integrate MinGit/BusyBox in our build2 project, the more general question is: can we rely on MinGit/BusyBox going forward or this combination is being deprecated or some such?
karen-arutyunov commentedon Apr 21, 2026
In case anyone else suffers from the same issue and cannot switch from the
MinGit/BusyBox combination to the regular MinGit, here is a source code
patch for the https://github.com/git-for-windows/git.git repository.
Note that this patch is effectively a hack which assumes the use of BusyBox
instead of the real shell. The proper fix should probably add the BusyBox
applet argument conditionally to the being composed command line. Also, I'm
not familiar with the related code well enough to be sure that this is the
only place which needs to be amended. This patch, however, may be a temporary
solution while we are waiting for the proper fix.
dscho commentedon Jun 20, 2026
FWIW I recently put in a lot of work to update the BusyBox version in Git for Windows' MinGit-busybox package, and I just started to look a bit more into changing the way BusyBox'
ash.exeis called in the PR #3301 again. No promises about any timeline (or whether or not there will be another multi-year pause in this PR).mingit: ship BusyBox as sh.exe in the BusyBox-based MinGit
zcsizmadia commentedon Sep 17, 2026
Same root cause as #5184: the BusyBox-based MinGit has no
sh.exe,git_shell_path()falls back to the path ofbusybox.exeitself, and BusyBox treats-cas an applet name. Still reproduces withMinGit-2.55.0.5-busybox-64-bit.zipon a PATH restricted toC:\Windows\System32,C:\Windowsand MinGit'scmddirectory:git-for-windows/build-extra#746 ships a copy of
busybox.exeasmingw64/bin/sh.exein that variant. With the copy in place inside the extracted 2.55.0.5 zip, the local clone succeeds and the trace shows.../mingw64/bin/sh.exe -c 'git-upload-pack ...'. No source change torun-command.cis needed for this part.mingit: ship BusyBox as sh.exe in the BusyBox-based MinGit