2

User does not have access to the git commands yet, the Admin does have access to the git commands. I do not want to keep running my cmd prompt as admin.

What have I done:

  • I have installed git for windows
  • I can run git commands from cmd escalated to admin

When I attempt to edit my environment i'm always asked to do so as admin and it seemingly only is altering the admins environment.

OS: Windows 10

Arount
  • 9,853
  • 1
  • 30
  • 43

2 Answers2

2

You might also consider an alternative way to install/use Git for Windows, with a simplified PATH and a portable Git (like PortableGit-2.20.1-64-bit.7z.exe), uncompressed anywhere you want.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

In that CMD (run as a regular user, not admin), check if the Git commands are available.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

After looking deeper I asked the right question to the google verse. While this solution below is for vista it still seemingly applies for Windows 10. When you try and do an edit like this the normal way it will not allow you to do so. You in essence run that program as the Administrators account.

In order to get around this you need to go to your User accounts page and there is an option in there titled "Change my environment variables." It is here that you can actually apply these to your local user.

https://support.microsoft.com/en-us/help/931715/you-cannot-modify-user-environment-variables-in-the-system-properties