How to enable using Git repository with files with long paths for all users?

This is the recommended approach as it avoids modifying system settings. Each user can enable long paths in their Git configuration by adding a line to their .gitconfig file:

longpaths = true

There are two ways to achieve this for all users:

  • Provide Instructions: You can simply provide clear instructions to developers on how to add this line to their .gitconfig file. This ensures they understand the configuration and potential implications.
  • Batch Script (Windows Only): (For Windows environments) Create a batch file with the following command:

git config --global core.longpaths true

This script can be run by developers to automatically configure their Git for long paths.

Leave a comment

Your email address will not be published. Required fields are marked *