0

In trying to use Git in Visual Studio Code for the first time to manage two projects, one seems to behave fine, however one keeps returning the following error in the "output" window when doing any Git action (commit, create branch, stage, etc.).

warning: encountered old-style '//x.x.x.x/wwwroot/local/domain.com/' that should be '%(prefix)///x.x.x.x/wwwroot/local/domain.com/'

The thing is, this error references the first project, not the second one I'm currently performing Git actions on, and I don't have any idea where it's coming from.

  • Both repositories are local only (for now) in the original development locations. (This is step one in moving to Git.)
  • I have tried recreating the local Git repository from scratch ("initialize" from Visual Studio Code, and also "git init" from the command line)
  • There aren't any files inside either project (including folders .vscode and .git) that reference the other project
  • I can't find any reference to either project in Visual Studio Code settings in my Windows profile (except the session cache SQLite DB)

What should I be looking at to fix this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
KolonUK
  • 443
  • 1
  • 6
  • 14

1 Answers1

0

The issue was that the Windows local Git configuration has a list of safe trusted locations for remote Git repositories.

When using CIFS/SMB locations, you need the string "%(prefix)/" to prefix the path (see What is $(prefix) on $(prefix)/etc/gitconfig?).

For some reason, my local "c:\users\xxx\.gitconfig" had the path stored without the prefix, something which Git via Visual Studio Code should have done.

Removing the offending lines opened up Git for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
KolonUK
  • 443
  • 1
  • 6
  • 14