Windows git bash - child processes see system PATH environment variable instead of user...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This happens on my Windows 7 Home Premium x64 SP1 Desktop, but not on
my Windows 10 Pro x64 laptop.

Everything used to work fine until I updated my Desktop to the latest
version of Git (the laptop has the same version but was a totally
clean install as it is a new laptop)

Edward@Edward-PC MINGW64 /f/Work
$ echo $PATH
...(USER PATH)...

Edward@Edward-PC MINGW64 /f/Work
$ cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

F:\Work>echo %PATH%
echo %PATH%
...(SYSTEM PATH)...

The same is true of any child process (e.g. node.js) - they all see
SYSTEM PATH now instead of USER PATH.
I have tried clean reinstalling git.
I have tried both the 64-bit and 32-bit versions of git.

Used Process Explorer to investigate the environment of the processes
on the 2 machines. The only significant difference I can see is the
PATH variable in cmd.exe.

If I double-click bash.exe (instead of the shortcut to git-bash.exe)
then the user PATH is seen by child processes.
Double clicking git-bash.exe, still has the problem.
Running bash -l from a cmd window, has the problem.

Run bash.exe, then
sh
echo $PATH
// Shows user path
cmd
echo %PATH%
// Now shows system path
So bash saw user path, sh saw user path but then cmd was passed the
system path?!

Run bash.exe followed by cmd, cmd, cmd, etc - cmd always sees user path.
So bash -l and sh both see user path but then only forward system path
to child processes...

sh definitely used to work as well as the git bash shortcut (I know
because I run git bash > grunt > sh and that now sees the
wrong/incomplete path when before it was working fine)

I have spent most of this frustrating day trying to figure out what is
going wrong but do not have a clue.

I have no .bashrc or .bash_profile files on either system (no idea
what these are for but a colleague was trying to help diagnose the
problem - they ultimately came up empty).
As far as I can tell the 2 systems are set up exactly the same (apart
from the different Windows versions of course).
Path length is not an issue as the (working) laptop has a huge path
whereas the (not working) desktop has less than 500 characters.

Unfortunately I don't know what version of git I had before, and older
versions aren't offered for download so I can't trial and error.
Really wishing I hadn't upgraded!

Any assistance would be much appreciated as I am totally pulling my
hair out now.

Many thanks and kind regards,

Edward Marshall
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]