Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

: File name too long when trying to pull or push

Hi everyone,

 

I am using a MacOS and trying to pull stuff from the repository to then be able to push my changes. However, I get the error that I have untracked files with file names that are too long. No matter what I do, it won't let me pull stuff. The person who added those files is using Windows. 

 

Can someone please help me with this problem?

 

Thanks

1 Reply
Community Manager
Message 2 of 2

Re: : File name too long when trying to pull or push

What is the exact error you're receiving? Where are you storing the git repository? Can you shorten the path to the directory that you're storing the git repository in?

 

For example, one theory I have as to why the path may be too long is that you're storing the git repository in something like:

 

/Users/some-really-really-really-really-really-long-user-name/with/a/really/long/path/that/goes-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on-and-on/and-on/project-name

If you cloned the git repository into:

 

/Users/some-really-really-really-really-really-long-user-name/project-name

then the pulling might work better. This is because there's a maximum path length on macOS of approximately 1,000 characters and no individual component (the part between slashes) can be longer than 255 characters.

 

So if the error is because the entire path is too long, then my suggestion may help you. If the error is because some individual component name is too long, then the only thing you can do is rename the component in the repository. And if git is choking on the file name (so that GitHub can't display the repository correctly), then the person on Windows may have to rewrite the repository history to fix the problem.

 

I hope that helps! Let us know if you have more details or questions.