I am trying to clone a GitHub repository containing files with long path names, and I am trying to get around Git's file length restriction using the command
git config --system core.longpaths true
However, I am getting the error messages:
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Invalid argument
This seems strange, as the command is trying to change a file in Program Files, not in C:\Users\username where it should be. Furthermore, when I checked C:\Users\username for a .gitconfig file, I was unable to find one. Does anyone know what is going on?
You want
git config --global.That is expected behavior. Since you ran
git config --systemit will look for a system-wide config file. From thegit-configdocs...What you probably want is
git config --globalto write to YOUR global git config file in your user directory. This is in contrast togit config --localwhich is for writing to the current repository's config file in.git/config.I expect
msysgitdidn't change the behavior ofgit config --system, so it's naively mashing together a Windows style prefixC:\Program Files\Git\mingw64with a Unix style/etc/gitconfigand getting a nonsense path with mixed delimiters.Consider letting them know about this behavior and suggest it be given a better error message.