Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "bash: git: command not found" #2785

Closed
4 tasks done
asverq opened this issue Nov 18, 2022 · 16 comments
Closed
4 tasks done

[Bug] "bash: git: command not found" #2785

asverq opened this issue Nov 18, 2022 · 16 comments

Comments

@asverq
Copy link

asverq commented Nov 18, 2022

Version Information

Cmder version: v1.3.20
Operating system: Windows 10 Pro 22H2 (with all updates)

Cmder Edition

Cmder Full (with Git)

Description of the issue

Any command with git, fire an error: "bash: git: command not found"

How to reproduce

In Windows 10 Pro 22H2

  1. Install to system a Git from official site https://git-scm.com/
  2. Run Cmder with standard configuration
  3. Change standard configuration to default task on startup to {bash::bash}
  4. Run Cmder and working good
  5. Uninstall system installed Git
  6. Run Cmder, type any git command and it not working with error "bash: git: command not found"

Additional context

Google Translate : Git was already installed on my system, which was downloaded from the official website (https://git-scm.com/) and installed. When I wanted to work with Cmder, I downloaded the archive with the latest version (Full version with Git), unpacked it and ran the Cmder.exe file, the program was fully initialized, I went to the settings and changed the default task to {bash::bash} and saved settings and restarted the program. Everything was working fine until I remembered that Git was already installed and uninstalled it. After that, Cmder with a Bash shell doesn't see Git from its own package.

I uninstalled Cmder unpacked again but nothing helps, when I write any git command I get "bash: git: command not found"

Original Ukrainian text: В моєї системі вже був встановлений Git який був скачаний з офіційного сайту (https://git-scm.com/), та встановлений. Коли я захотів працювати з Cmder я скачав архів з останнею версією (Full version with Git), розпакував його та запустив файл Cmder.exe, пройшла повна ініціалізація програми, я зайшов в налаштування та змінив задачу по замовчанну на {bash::bash} зберіг налаштування та перезапустив програму. Все працювало добре, поки я не згадав про встановлений вже Git, та видалив його через Uninstall. Після цього Cmder з оболонкою Bash не бачить Git з власного пакунку.

Я видаляв Cmder розпаковував заново але нічого не допомагає, коли я пишу будm-яку команду git, отримую відповідь "bash: git: command not found"

Screenshot of startup task:
Знімок екрана 2022-11-18 191113

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.
@asverq
Copy link
Author

asverq commented Nov 18, 2022

And I seek any solution to fix the problem, thank you.

@daxgames
Copy link
Member

Delete the git folder that was created by the git installer. It left something behind.

Probably in c:\program files\git or c:\program files (x386)\git

@asverq
Copy link
Author

asverq commented Nov 18, 2022

Delete the git folder that was created by the git installer. It left something behind.

Probably in c:\program files\git or c:\program files (x386)\git

success, but it have no effect =(
and I am making full clear regedit for Cmder parameters after deleting folders and /Unregister ALL, it nothing working

@asverq
Copy link
Author

asverq commented Nov 18, 2022

And one else: if I running {cmd::Cmder} task it working good, only Bash shell doesn't working.
Знімок екрана 2022-11-18 205917
Знімок екрана 2022-11-18 205945

@daxgames
Copy link
Member

daxgames commented Nov 18, 2022

I recreated your issue.

I fixed it by deleting in c:\program files\git and/or c:\program files (x386)\git.

If you have done that then I don't know what is causing it.

From inside the bas session type echo $GIT_INSTALL_ROOT.

That is the problem folder.

@asverq
Copy link
Author

asverq commented Nov 18, 2022

Thank you for you answer!
I am now installing a clean Windows on VirtualBox and will try to reproduce it.
Sorry for my bad English.

@asverq
Copy link
Author

asverq commented Nov 18, 2022

It is strange, but I get the same problem on the VirtualBox...
And deleting Git directory from Program Files is not fixed it.
Restart, Reinitialization of Cmder or Windows doesn't working too...
Знімок екрана 2022-11-19 005622

@daxgames
Copy link
Member

daxgames commented Nov 19, 2022

You have to restart the session. Open a new bash or close cmder and reopen.

@asverq
Copy link
Author

asverq commented Nov 19, 2022

You have to restart the session. Open a new bash or close cmder and reopen.

Yes, I understand, on the last screenshot only one of try. I am restarting everything, include windows, full deleted Cmder directories and reinitiated it, any scenario have no effect for me, I have no Idea what I can do more else, exclude reinstall windows but ...

@daxgames
Copy link
Member

daxgames commented Nov 19, 2022

Output of echo $PATH?

@asverq
Copy link
Author

asverq commented Nov 19, 2022

/c/Users/User_X/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/d/cmder/vendor/conemu-maximus5/ConEmu/Scripts:/d/cmder/vendor/conemu-maximus5:/d/cmder/vendor/conemu-maximus5/ConEmu:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files/nodejs:/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/Users/User_X/AppData/Local/Microsoft/WindowsApps:/c/Users/User_X/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/User_X/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl
Знімок екрана 2022-11-19 040020

@daxgames
Copy link
Member

I think you are experiencing a bug that is present in the current release. Cmder is not detecting its own vendored git install.

Try this unreleased build.

@asverq
Copy link
Author

asverq commented Nov 19, 2022

Thank you very much for your answers! But any unreleased build it's to hard for me, sorry, maybe I am will seek other way to fix the problem.

p.s. not fun fact: when I was worked on this my city was hit rocket attack, just living in Ukraine now ='(

@daxgames
Copy link
Member

The unreleased build is just a zip file just like the released build. Just unzip it into your Cmder Folder.

You could also simply add 2 missing files to your existing install and it will fix it.

Add git-prompt.sh and cmder.sh to %cmder_root%\vendor\git-for-windows\etc\profile.d

@asverq
Copy link
Author

asverq commented Nov 19, 2022

@daxgames I added this 2 files and problem was fixed, thank you!

@daxgames
Copy link
Member

No problem. You got hit with a double bug.

  1. The current release is missing those files.
  2. Even if the files were there it still would have failed if either of the Git folders in the program files locations were left behind by the git uninstall.

The two scripts I gave you were updated to look for a git.exe in those locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants