{"id":961,"date":"2023-09-03T08:57:25","date_gmt":"2023-09-03T08:57:25","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=961"},"modified":"2023-09-04T09:08:39","modified_gmt":"2023-09-04T09:08:39","slug":"git-error-filename-too-long-clone-succeeded-but-checkout-failed","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/git-error-filename-too-long-clone-succeeded-but-checkout-failed\/","title":{"rendered":"Git Error: Filename too long &#8230; Clone succeeded, but checkout failed."},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"253\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-1024x253.png\" alt=\"\" class=\"wp-image-962\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-1024x253.png 1024w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-300x74.png 300w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-768x190.png 768w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-1536x380.png 1536w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17-850x210.png 850w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/09\/image-17.png 1714w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Git has a limit of 4096 characters for a filename, except on Windows when Git is compiled with msys. It uses an older version of the Windows API and there&#8217;s a limit of 260 characters for a filename. The error message you&#8217;re encountering indicates that there is a problem with the length of a file or directory name in your Git repository, and it&#8217;s likely related to the path &#8220;blog\/&#8230;.\/pharmaceutical-inc&#8221; being too long for your file system to handle.<\/p>\n\n\n\n<p>To resolve this issue:<\/p>\n\n\n\n<p><strong>Shorten Directory Names<\/strong>: The most straightforward solution is to shorten the directory names in your repository. Try to rename the &#8220;pharmaceutical-inc&#8221; directory to something shorter, which should help you avoid the filename length limit issue.<\/p>\n\n\n\n<p><strong>Use a Different Filesystem<\/strong>: If you&#8217;re on a Unix-based system (like Linux or macOS) that enforces filename length limits, consider using a different filesystem that supports longer filenames. For example, you could use a filesystem like ext4 on Linux, which has longer filename support.<\/p>\n\n\n\n<p><strong>Git Configurations<\/strong>: You can also check your Git configurations related to path lengths. For instance, you can try running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --system core.longpaths true\r\n<\/code><\/pre>\n\n\n\n<p>Another way (only for this clone):<\/p>\n\n\n\n<p>git clone -c core.longpaths=true &lt;repo-url><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git has a limit of 4096 characters for a filename, except on Windows when Git is compiled with msys. It uses an older version of the Windows&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[317,318,320,319,316],"class_list":["post-961","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-but-checkout-failed","tag-filename-too-long","tag-git-config-system-core-longpaths-true","tag-git-error","tag-git-error-filename-too-long-clone-succeeded"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=961"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/961\/revisions"}],"predecessor-version":[{"id":963,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/961\/revisions\/963"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}