On Windows using git repository with long paths causes errors for example for pull
:
"Fatal: cannot create directory at PATH: Filename too long".
To solve that all repository users can add "longpaths = true"
to their .gitconfig
files. But how can I do this so that other users don't have to worry about it and can use the repository normally?
You can't make a central repository configuration that will automagically propagate out to everyone that clone your repository.
As such you're left with the following options:
Advice or help your programmers on how to configure their git accordingly
For instance, you could provide the git command for them or even a batch file with:
git config --global core.longpaths true
Be aware that unless you do 1 or 3, there is no guarantee that any editor or whatever you use to relate to the files in the repository will be able to access the files if their paths are still that long. In other words, even if you persuade git to handle long paths, your favorite code editor or build system might not be able to.
My best advice is thus to use point 1, try to shorten the paths down to it not being a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With