Clone succeeds but checkout fails due to longer file name issue

After cloning complete repository checkout fails, core reason is Windows MAX_PATH Limitation (260 characters. Older Windows versions (pre-Windows 10, version 1607) and default configurations in newer versions impose a 260-character limit on file paths.

Solution:

Enable Win32 long paths in Group Policy:

Open gpedit.msc (Local Group Policy Editor).

Navigate to Computer Configuration > Administrative Templates > System > Filesystem.

Enable the "Enable Win32 long paths" setting.

Configure Git to use long paths:

Open Git Bash or Command Prompt as Administrator.

Run the command: git config --system core.longpaths true


Note:

Before running the command "git config --system core.longpaths true" you have to run terminal as administrator. To do that press win key + x and click the Windows terminal(Admin) option

No comments:

Post a Comment

Fix GRUB dual boot issues after upgrading Kali Linux

To fix GRUB dual boot issues after upgrading Kali Linux, you can either use the command line to update GRUB or use a tool like Boot-Repair. ...