I was using Git and it was working fine but after a restart, it shows the following error:
git-sh-setup: file not found
How to solve this issue?
The git sh-setup scriptlet is designed to be sourced (using . ) by other shell scripts to set up some variables pointing at the normal Git directories and a few helper shell functions.
DESCRIPTION. git-sh starts an interactive bash(1) session modified for git-heavy workflows. Typical usage is to change into the directory of a git work tree or bare repository and run the git-sh command to start an interactive shell session.
I've run into this issue with the latest Git on Windows (v2.17.1.windows.2) and solved it both for cmd
and PowerShell by adding two directories to PATH
:
C:\Program Files\Git\usr\bin
C:\Program Files\Git\mingw64\libexec\git-core
From elevated powershell you could set it using:
$env:Path += ";c:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\libexec\git-core" Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $env:Path
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With