Invalid path, fatal: unable to checkout working tree while cloning the repository in Windows

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Unable to clone the repository in Windows and getting the below error:

1 2 error invalid path - filename fatal unable to checkout working tree

Environment

  • Windows

Cause

Windows reserves certain file names. So when it tries to create a file that uses a reserved base name or uses special characters it will fail.

Please refer to the Naming a file Windows documentation:

Do not use the following reserved names for the name of a file:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended

  • The following reserved characters:

    • < (less than)

    • > (greater than)

    • : (colon)

    • " (double quote)

    • / (forward slash)

    • \ (backslash)

    • | (vertical bar or pipe)

    • ? (question mark)

    • * (asterisk)

Solution

  • Check the git repository you are trying to clone and analyze if there are any file names consisting of the Windows Reserved Characters.

  • Rename the file by removing all the reserved characters in the remote git repository.

  • Try cloning the repository again and it should clone without any issues.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.