We are all about adding value to the industry. We provide high-quality and remarkable tech solutions to all our clients across the globe.
The people of Addact are truly unique and we invite you to be a part of our growth journey!
Find out moreWe use cookies to ensure that we give you the best experience on our website. If you continue to use this site, you consent to the use of cookies. privacy policy and cookie policy.
While dealing with YML files that are created by Sitecore,
I faced one error that said the File name was too long when I tried to push my change to the origin of the branch in GitHub.
The "GitHub Long-path Error" typically occurs when you're trying to work with files or directories in a Git repository, and the file path exceeds the maximum path length allowed by the Windows operating system. This issue is commonly encountered on Windows systems due to Windows' historical limitation on file paths, which is 260 characters.
when Git is compiled with msys. It uses an older version of the Windows API and there's a limit of 260 characters for a filename.
But Git has a limit of 4096 characters for a filename, to enable this we need to add
“longpaths = true” in the config file of our repo’s git configuration file which then allows us to use the character limit of 4096 for the file name.
File location: (Repository name)\.git\config
We need to add this line in the [core] section and save the config file.
Now when you reopen the GitHub error should be gone. We can now successfully commit and push the files into the branch (Origin).
Git should now handle long file paths on Windows without triggering the GitHub Long-path Error. This configuration change allows Git to work with file paths longer than the traditional Windows limit.