1

I have added C:\Program Files (x86)\Git\cmd to my path environment variable.

All git commands run successfully but also open a new console which displays git's help.

Running git.exe directly also opens a separate console.

This is quite annoying as I see a popup every time I try to run a git command.

rlesias
  • 4,786
  • 3
  • 15
  • 20

1 Answers1

1

You should only add C:\Program Files (x86)\Git\bin to your PATH, not the cmd folder.

That should be enough to avoid the new console to popup every time.

Try the same (bin only to PATH) with a simple PortableGit-1.9.5-preview20150319.7z uncompressed anywhere you want.


Note: Git 2.42 (Q3 2023) offers a headless-git.exe, a non-console program that does not pop up any window.
That can be an alternative to test out here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @rlesias I have edited the answer: try the same with the PortableGit-1.9.5-preview20150319.7z archive. – VonC Apr 12 '15 at 14:20
  • this the version I use. I have tried to reinstall Git without result – rlesias Apr 12 '15 at 14:21
  • @rlesias I know. Try, just for testing, to uncompress PortableGit-1.9.5-preview20150319.7z and add the bin folder to your PATH. No setup required. – VonC Apr 12 '15 at 14:24
  • sorry, I was too fast. It works with the Portable version. Thanks! – rlesias Apr 12 '15 at 14:25
  • I accepted your answer but still would like to understand why it doesn't work with the standard version. – rlesias Apr 12 '15 at 14:27
  • @rlesias Not sure: a similar issue was reported in https://github.com/msysgit/git/issues/316. I never use the setup myself, always the archive. Plus, msysgit is no longer actively maintained. All the work is for Git 2.3 now: https://gist.github.com/shiftkey/add6975be2687d8731ae (Git for Windows: https://github.com/git-for-windows/git/releases) – VonC Apr 12 '15 at 14:30