Unable to pull the latest commits due to file name error
deadlyvices opened this issue · 18 comments
I get this when I try to pull down the most recent changes using git:
E:\source\repos\CEVOpen [master ↓59 ↑1]> git pull
fatal: cannot create directory at 'articleAnalysis/oil186/raw/Example_Table_Images/APA/Anti-Bacterial — MIC, DD:IZ': Invalid argument
Can someone please change the name of the offending folder so it works on Windows? it's the ':' that's causing the problem: Windows interprets this as a file stream. Until this is done, I'm unable to do any commits.
I also think that leaving commas and other punctuation characters out of filenames would greatly help portability!
It's probably wise to follow the rules listed here
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
This article has a simpler to read list, but I think it equates to the same thing
https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names
I think the second answer (with 433 votes at present) i easiest to read
Hello manny sir!
It needs to rename the files which you have committed. There is an issue while git pull. For example -
./articleAnalysis/oil186/raw/Example_Table_Images/APA/Anti-Bacterial — MIC, DD:IZ/Anti-bacterial — MEO, DEO, .textClipping
filenames
The filenames have to work on a variety of Operating systems. The main problems (to avoid) are:
- long pathnames (good idea to keep directory names < 15 characters
- avoid names that differ in case-sensitivity (e.g. not
myfile.dat
andmyFile.DAT
in same directory. - avoid punctuation and any spaces
Recommended characters:
a-z0-9_
Use '.' only for suffix
I think the current problems are caused by Manny's commits - @mannyrules you will have to change your filenames and recommit.
I would say do NOT use file names or folders which differ only by case.
It will also be wise to keep the total path to less than 260 characters (including path separator) as some parts of the Windows OS still have this limit.
Also cloning your repo to C:\Dev\Project also helps to shorten file paths.
Can I suggest a simple rule? Stick to:
- lowercase letters
- digits
- underscores
- hyphens
- the period
So any filename that matches the regex [a-z0-9._-]+ should be right as rain
A bit more complex that filenames that begin with a single dot should be avoided.
Filenames with two consecutive dots next to a path separator are not permitted.
I think we have all said essentially the same thing.
Good
Hello manny sir!
It needs to rename the files which you have committed. There is an issue while git pull. For example -
./articleAnalysis/oil186/raw/Example_Table_Images/APA/Anti-Bacterial — MIC, DD:IZ/Anti-bacterial — MEO, DEO, .textClipping
Thanks for letting me know. I'll clean these up and repost as soon as possible.
That text clipping was not meant to be in there. I just deleted it. Sorry for any confusion.
I'm still getting these issues, and it's now stopping me from working:
fatal: cannot create directory at 'articleAnalysis/oil186/raw/Example_Table_Images/GRID/Anti-MICRO?ORGANISM': Invalid argument
I use git as much for sharing my work between my home and my work PC, so this is stopping me from doing that.
Thanks.
Just created a fresh folder on my pc C:\Temp\test
git clone https://github.com/petermr/CEVOpen.git worked without a hitch
Well done @petermr