Latest Update brings Github error on pull, push, or sync

这一生的挚爱 提交于 2019-12-09 17:41:07

问题


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 following in the Output window:

Warning: 'C:\ProgramData/Git/config' has a dubious owner: '(unknown)'.
For security reasons, it is therefore ignored.
To fix this, please transfer ownership to an admininstrator.

回答1:


You should check if 'C:\ProgramData/Git/config' actually exists. If it doesn't you can just create it and paste the following into the file:

[core]
    symlinks = false
    autocrlf = true
    fscache = true
[color]
    diff = auto
    status = auto
    branch = auto
    interactive = true
[help]
    format = html
[rebase]
    autosquash = true

This worked for me.




回答2:


I fixed it by going to Visual Studio Installer, choosing individual component and searching for "Git". In my case the "Git for Windows" and "GitHub Extension for Visual Studio" was now unchecked/not installed for some reason..

These are the extensions I needed: Visual Studio Installer Git

Installing those create the ProgramData\Git\config file and the error was gone.




回答3:


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.




回答4:


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.




回答5:


Uninstall Git and install a downgraded version. The version that shows this problem is the 2.23.0. Downgrade it to the 2.22.0 and it works fine without this problem.

Git releases: All git releases Git 2.22.0: Version without this issue




回答6:


Delete the file config file from C:\ProgramData/Git directory and try again.




回答7:


I had this problem with Git 2.24.0.2 and visual studio 2019 - 16.2.3. I couldnt create the path and config file in c:/ProgramData/git/, as I dont have admin rights. It turned out that the windows credentials stored are expired for my user account and when updated using control panel > user accounts > credential manager > Generic credentials for git helped to resolve the issue in my case




回答8:


The "Git" folder was missing from the path c:/ProgramData/Git/Config. I created the folder (not the config file) and it worked fine



来源:https://stackoverflow.com/questions/57592530/latest-update-brings-github-error-on-pull-push-or-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!