Top community members

Welcome to Dirask IT community! ‚̧ ūüíĽ
We are community that shares solutions with each other.

If you think you have something to add here.

you are welcome with your fresh ideas - List Articles


Git - filename too long error

3 points
Created by:

In this article we would like to show how to let git working with long paths.

Quick solution:

git config --system core.longpaths true

Below you can find the example, when the problem occured and different ways for to set up loner paths for git using different approaches.

1. Problem

When I execute git pull command I get fllowing error:

$ git pull
error: cannot stat 'very/long/path/here.../filename.png': Filename too long
Updating 42f6e00..66294e7

2. Solution

There are two ways how to fix configuration:

  • with git command,
  • with .gitignore file.

2.1. with git command example

When we want to set up paths we can execute in console following command:

  • ¬†for all operating system:
git config --system core.longpaths true
  • or only for current repository:
git config core.longpaths true

2.2. with .gitconfig file example

The solution presented in this section works only with repositories that uses the file.


  1. go to .gitconfig file (example path for user in linux ~/.gitconfig),
  2. create [core] section if it does not exist,
  3. add longpaths = true in the section.

.gitconfig file example:

longpaths = true

Note: .gitcofig file can be located inside project location or in the user home directory.

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey ūüĎč
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more