11. August 2017

Git fetch or clone or checkout filename too long fatal error Windows

Windows had a 260 character path limit, so if you put your git repository in Documents and Settings with a long username, you might soon hit into a problem. This limitation is not depended on cmd or command (or any other shell), but it is inside Windows itself. Errors will look like:


fatal: failed to read object objecthash: Filename too long
fatal: '$GIT_DIR' too big
Failed to clone 'XXXXX'. Retry scheduled

The solution is not really easy to find on Internet, but in fact Microsoft published it in https://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath. They claim that in Windows 10 this limitation is removed, but I have not tested it.

Newest from this category: