A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Visual Studio 2022 17.14.39 no longer able to use git when logged in as different user
I need to run Visual Studio (2022) as two different users, as only some of the projects I work on are allowed to use Github copilot (customer restrictions).
So, I have a primary account "seb", where my main VS runs, which is not logged in into github copilot.
I have a secondary windows account "seb-copilot", and run VS via "runas /user:seb-copilot".
The new instance of VS (as seb-copilot) doesn't trust the git checkout as "seb", of course, as the owner isn't the current user. So, I added [user] name, email, and [safe] directory = ... to C:\Users\seb-copilot.gitconfig.
With the previous version of VS (17.14.38), this worked. The VS UI to configure user name/email and safe directory didn't work, but .gitconfig worked.
Since updating to 17.14.39, this no longer works. Even with [safe] directories, and [user] name, email, VS doesn't "know" about this information.
This is not an issue of git itself, the Developer PowerShell integrated in VS itself can use git without issues, and so does git commandline running as "seb-copilot".
** Visual Studio 2022 Developer PowerShell v17.14.39
PS F:\Devel3> git version
PS F:\Devel3> git config get --global safe.directory
F:/Devel3/*
PS F:\Devel3> echo $env:USERNAME
seb-copilot
Note that the whole "using two different windows user accounts for development at the same time" is only necessary, as VS doesn't allow a "root context" or any other construct where some VS sessions / instances are logged into github copilot, while others are not. We have several different customers, and some expect use to use AI, while others understandably refuse to have AI access their intellectual property.
I can of course change the ownership of the folder structure to seb-copilot, and then will probably have the same issue in reverse.