Filename too long  error: unable to index file error while adding files in GIT AEM repository | Community
Skip to main content
Level 4
August 13, 2020
Solved

Filename too long  error: unable to index file error while adding files in GIT AEM repository

  • August 13, 2020
  • 3 replies
  • 14319 views

Hi Experts,

 

I am getting below error when i am try to add add files in GIT repository 

 

git add .

 

 how to fix Filename too long  error: unable to index file   issue ?

 

The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in ui.content.sample/src/main/content/jcr_root/content/dam/wknd/en/contributors/stacey-roswells.jpg/.content.xml.
The file will have its original line endings in your working directory
error: open("ui.content.sample/src/main/content/jcr_root/content/dam/wknd/en/contributors/stacey-roswells.jpg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml"): Filename too long
error: unable to index file 'ui.content.sample/src/main/content/jcr_root/content/dam/wknd/en/contributors/stacey-roswells.jpg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml'
fatal: adding files failed

 

or


The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in ui.content.sample/src/main/content/jcr_root/home/groups/wknd/MolAFMcBDSSfI902CqgF/_rep_policy.xml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in ui.content.sample/src/main/content/jcr_root/home/groups/wknd/MolAFMcBDSSfI902CqgF/profile/photos/primary/image.dir/.content.xml.
The file will have its original line endings in your working directory
error: open("ui.content.sample/src/main/content/jcr_root/home/groups/wknd/MolAFMcBDSSfI902CqgF/profile/photos/primary/image.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png"): Filename too long
error: unable to index file 'ui.content.sample/src/main/content/jcr_root/home/groups/wknd/MolAFMcBDSSfI902CqgF/profile/photos/primary/image.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png'
fatal: adding files failed

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SundeepKatepally

.dir folders are created when you move content from crx to eclipse or local file system. 

Ideally these files should not be committed. Better add that pattern in git.ignore  ,so that it will not even ask for commit.

3 replies

SundeepKatepally
Community Advisor
SundeepKatepallyCommunity AdvisorAccepted solution
Community Advisor
August 13, 2020

.dir folders are created when you move content from crx to eclipse or local file system. 

Ideally these files should not be committed. Better add that pattern in git.ignore  ,so that it will not even ask for commit.

vanegi
Adobe Employee
Adobe Employee
August 13, 2020

Hi @sonuk85184451,

Can you run the below command in git as Administrator and see if that helps:

git config --system core.longpaths true.

 

This is discussed in https://stackoverflow.com/questions/52699177/how-to-fix-filename-too-long-error-during-git-clone

https://www.jeffryhouser.com/index.cfm/2017/6/29/How-do-I-fix-Filename-too-long-error-on-SmartGit-on-Windows

 

Thanks!!

 

VeenaVikraman
Community Advisor
Community Advisor
August 17, 2020

 git config --system core.longpaths true . Normally whenever I faced this issue, running the above command helped

 

Thanks

Veena