Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle files committed to Git on Linux with invalid Windows filenames?

Tags:

git

linux

windows

I committed some files with a name containing ':' and '"' characters, which are invalid on Windows. When I try to git pull from a Windows machine it gives me an error message.

Is there a way to rename these files on the repo from the Windows machine? Or is there any other workaround?

like image 810
mtgred Avatar asked Dec 06 '10 10:12

mtgred


People also ask

How do I enable long path support in git?

windows-10-git.mdGo to Computer Configuration > Administrative Templates > System > Filesystem in gpedit. msc , open Enable Win32 long paths and set it to Enabled .

How do you stop filenames too long?

To resolve this behavior, make sure that the path of the file contains less than 256 characters. To do this, use one of the following methods: Rename the file so that it has a shorter name. Rename one or more folders that contain the file so that they have shorter names.


2 Answers

If you have an access to a linux machine you can rename it, do the according changes into the code, and push to the repository (with appropriate comment)

like image 179
Eineki Avatar answered Oct 05 '22 23:10

Eineki


You could try doing a "sparse checkout" so that you don't check out those files on Windows.

https://stackoverflow.com/a/13738951/316578

Of course, this only works for you if it's okay not to have those files present on Windows.

like image 25
Anthony Hayward Avatar answered Oct 05 '22 23:10

Anthony Hayward