0

Our corporate PCs have git installed which always tries to gain admin access on any git command, Even git --version. This is weird that git is designed that way that it need admin access for any git command.

We have Beyond trust privilege management which keep tracks of any application which tries to take admin access, this process takes a very long time to verify and because of this git works very very slow in all PCs.

Eclipse has its own integrated git which works fast as it doesn't take admin rights to do operations.

Is there a way we can run git without admin rights in Windows 10?

topgun
  • 43
  • 1
  • 10
  • Is git installed in Program Files? – blami Oct 13 '22 at 07:56
  • 2
    *This is weird that git is designed that way that it need admin access for any git command.* --> It's not the case. **Your** installation is such, I don't doubt it, but it's not by design. This is a system administration problem. – Romain Valeri Oct 13 '22 at 08:00
  • yes, installed in Program files. – topgun Oct 13 '22 at 08:05
  • You should explain exactly how do you launch git (what kind of console are you using, where git executable is located, its build version and so on) and how exactly git tries to gain admin access. Are you sure that you are actually using real git? I doubt that it ever had a functionality to demand admin access. – user7860670 Oct 13 '22 at 08:41
  • I installed the portable version of git and put it in different folder and tried git --version as well. It again wants to take admin rights and slows down – topgun Oct 13 '22 at 08:49
  • Portable version of git can not be installed because it is portable. `git --version` shouldn't invoke this portable version either. Please explain *exactly* what you are doing and what happens. – user7860670 Oct 13 '22 at 09:11
  • portable version was downloaded not installed. And the git command was run on the same directory where the git.exe is (/git/bin) but still it takes lot of time because of BMC privilege management scanning because of git is raising admin right in each call. – topgun Oct 17 '22 at 07:22

2 Answers2

6

Git can also be installed without admin privilege.

Use the --scope user switch with winget.

winget install --id Git.Git -e --source winget --scope user
user20921238
  • 61
  • 1
  • 2
  • That would be be nice, but it does not work for me: Installer failed with exit code: 4 msi log contains unable to create the directory "C:\Program Files\Git\dev". – Markus Apr 12 '23 at 10:01
0

Is there a way we can run git without admin rights in Windows 10?

Not only is it possible, it's perfectly normal.

There is an official Windows installer for git here: https://git-scm.com/download/win The installer requires admin access, but once installed, commands will run as a normal user.

There is also a "portable" version, which is a self-extracting archive that can be extracted to anywhere on your system, so doesn't even need admin permissions to install.

It sounds like your install of git has been installed with some additional permissions set such that only an admin has permission to the executable. That would be something to speak to your system administrator about.

IMSoP
  • 89,526
  • 13
  • 117
  • 169