In Visual Studio 2019, we have been using the GitHub extension successfully since before release. Now, all of the sudden, when we push, pull, or sync, we receive the follow
Delete or rename the existing file at that location is also an option. It looks like it's parts of some lower level windows (or MSYS2/Cygwin) security that's brought in via libgit.lib.
Why the created file has the wrong owner is not yet known.
Who/what is the owner for that existing file? What language is in use?
It's been noted as an issue at https://github.com/git-for-windows/git/issues/2304 but isn't resolved yet.
99% sure that above steps will fix the error.
The "Git" folder was missing from the path c:/ProgramData/Git/Config. I created the folder (not the config file) and it worked fine
Try using Visual Studio GIT extension and open Visual Studio as Administrator if you face below issue
warning: unable to access 'c:\programdata/git/config': permission denied warning has a dubious owner: '(unknown) git please transfer ownership to an administrator github config has a dubious owner
I had the same problem and I tried some of the tips given above but the problem keep existed. Then I directly went and updated the visual studios Installer and the problem fixed.
We ran into this exact issue after upgrading Git to version 2.23.0.windows.1 on our build agents.
The fix that worked for us was to change the owner of C:\ProgramData/Git/config to Administrators. Note that this is different to the Administrator user!
To do this, right-click on C:\ProgramData/Git/config and select Properties then the Security tab.
And click Advanced...
Use the Change link to set the owner to Administrators.