git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.19k stars 2.49k forks source link

Unable to lock config file error with GIT-2.45.1-64-bit.exe #4971

Open ATECoder opened 1 month ago

ATECoder commented 1 month ago

Setup

git version 2.45.1.windows.1 cpu: x86_64 built from commit: 965b16798dab6962ada5b0d8cf0dca68f385c448 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon

 - Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

$ cmd.exe /c ver Microsoft Windows [Version 10.0.22631.3593]


 - What options did you set as part of the installation? Or did you choose the
   defaults?

One of the following:

type "C:\Program Files\Git\etc\install-options.txt" type "C:\Program Files (x86)\Git\etc\install-options.txt" type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt" type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt" $ cat /etc/install-options.txt

Editor Option: Notepad++ Custom Editor Path: Default Branch Option: main Path Option: Cmd SSH Option: ExternalOpenSSH Tortoise Option: false CURL Option: OpenSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Git Pull Behavior Option: Merge Use Credential Manager: Enabled Performance Tweaks FSCache: Enabled Enable Symlinks: Enabled Enable Pseudo Console Support: Disabled Enable FSMonitor: Disabled

 - Any other interesting things about your environment that might be related
   to the issue you're seeing?

The installation worked fine on an existing release. I got the error when installing GIT after removing the existing version and deleting the git folder (c:\apps\git)

### Details

 - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

not applicable to this issue; all of the above

 - What commands did you run to trigger this issue? If you can provide a
   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
   this will help us understand the issue.

execute git-2.45.1.-64-bit.exe


 - What did you expect to occur after running these commands?

i expect the installation to complete without errors.

 - What actually happened instead?

The following error message appeared towards the end of the installation:

Could not lock config file c:apps/git/etc/gitconfig

Unable to set system config "filter.lfs.process" := "git-lfs filter-process".

File not found

exit code 255



 - If the problem was occurring with a specific repository, can you provide the
   URL to that repository to help us with testing?

not applicable

i attached the config file that was created. 
[gitconfig.zip](https://github.com/git-for-windows/git/files/15477627/gitconfig.zip)
dscho commented 1 month ago

Could not lock config file c:apps/git/etc/gitconfig

Please install into C:\Program Files\Git. The problem will most likely simply go away then.

ATECoder commented 1 month ago

Installing to c:\program files\git addresses this issue.

Note though that the uninstaller left numerous orphan entries in the registry. Consequently, opening git bash from the File Explorer shell context window fails with program not found error.

dscho commented 3 weeks ago

Note though that the uninstaller left numerous orphan entries in the registry.

You wouldn't happen to have recorded the list somewhere? That would be valuable information to add to this ticket.

ATECoder commented 3 weeks ago

I just searched for the partial filename string such as apps/git, and deleted these keys or values. Unfortunately, I did not keep a list. My thinking was that whom ever decides to tackle this issue will have to go through the process of installing and uninstalling the current version of Git since it likely changed some entries in the registry. In other words, with evidenced based engineering I thought that there is no way to fix this issue without actually going though this tedious task. I wonder if a power shell guru could spit out all the orphan keys and values.