Skip to content

Unable to clone remote repository with a clone path > 255 chars #2576

Closed
@rishabhBudhouliya

Description

@rishabhBudhouliya
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.26.0.windows.1
cpu: x86_64
built from commit: 9c98e1ccdfd839e4eaae1c2747d0088ef89d446b
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18363.720]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"

Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** Nothing that I can think of**

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Git Bash

git clone -c core.longpaths=true <repo-url>
  • What did you expect to occur after running these commands?

A fresh repository cloned in my local file system

  • What actually happened instead?

fatal: Unable to create temporary file 'C:/Users/techn/AppData/Local/Temp/mdyshjeqvvvkiotkhiimoqkhwjlmgqrdwwzhnrwlsimanqdqeutjmqcwnyprzzjftejzfjvvjknbsxoswabqdnbsbqnbnclnhbnvoewqnslobjqszcinqbpibonqbandlftxf14739883836305635481/zedtlkgruqbrdlhijcmwdltgocurldhkcxzjqlutteqqpljllmpofmhmkm/git-client-p': Filename too long

  • Steps to reproduce the issue:
1. Create a directory structure with char length 246, in my case, it is:    C:/Users/techn/AppData/Local/Temp/mdyshjeqvvvkiotkhiimoqkhwjlmgqrdwwzhnrwlsimanqdqeutjmqcwnyprzzjftejzfjvvjknbsxoswabqdnbsbqnbnclnhbnvoewqnslobjqszcinqbpibonqbandlftxf14739883836305635481/zedtlkgruqbrdlhijcmwdltgocurldhkcxzjqlutteqqpljllmpofmhmkm
2. Open a Git Bash and change into this directory
3. Use git clone -c core.longpaths=true https://github.com/jenkinsci/git-client-plugin.git (18 chars)
3. The resulting clone path is 264 chars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions