Cloning Repository
"invalid path 'assets/contributors/avatars/100072714?v=4.jpg' unable to checkout working tree warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/" I Am Seeing This Error While Cloning
Saw this while looking at other issues and was planning to clone anyway so thought to try and recreate.
I'm on Fedora 42 Cinnamon spin and unless I'm missing something... it seemed to work fine for me and I didn't see any errors while cloning or checking out.
$ git --version
git version 2.50.1
$ mkdir ~/Code/github/android && cd $_
$ git clone https://github.com/vicolo-dev/chrono.git vicolo-dev_chrono
Cloning into 'vicolo-dev_chrono'...
remote: Enumerating objects: 13126, done.
remote: Counting objects: 100% (835/835), done.
remote: Compressing objects: 100% (289/289), done.
remote: Total 13126 (delta 599), reused 546 (delta 546), pack-reused 12291 (from 2)
Receiving objects: 100% (13126/13126), 8.92 MiB | 6.06 MiB/s, done.
Resolving deltas: 100% (8624/8624), done.
$ cd vicolo-dev_chrono/
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/feature-fastlane-translation
remotes/origin/feature-i18n
remotes/origin/feature-widgets
remotes/origin/fix-remove-internet
remotes/origin/master
remotes/origin/release/0.5.0
remotes/origin/release/0.6.0
remotes/origin/release/0.6.1
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
$ git checkout -b release/0.6.1 --track origin/release/0.6.1
branch 'release/0.6.1' set up to track 'origin/release/0.6.1'.
Switched to a new branch 'release/0.6.1'
$ git status
On branch release/0.6.1
Your branch is up to date with 'origin/release/0.6.1'.
nothing to commit, working tree clean
$ find . -type f -iname '*100072714*.jpg'
./assets/contributors/avatars/100072714?v=4.jpg
Only thing that I could think might be an issue is that the file name is 100072714?v=4.jpg which contains ?. On Linux or Mac, this isn't an issue but if memory serves, Windows considers ? to be an illegal character for file/folder names. Since OS was not specified in the original report, that could be what is going on.
For someone on Windows who is trying to clone, might need to use a Linux VM. Possibly WSL (Windows Subsystem for Linux) might work also but I have never played with it. But I think even tools like MSYS or cygwin would still have an error using ? in file names as I'm pretty sure that is a filesystem-level restriction (e.g. the restriction is from ntfs partition format itself rather than from OS / which app is doing the writing). A VM would avoid this issue by creating its own virtual hard drive and formatting that with something less restrictive than ntfs (e.g. ext4 or btrfs are common Linux filesystems and neither have this restriction).
GPT5 said:
Windows has restrictions on file names (< > : " / \ | ? *) and some reserved names (CON, PRN, NUL, etc.). So when Git tries to restore these files, it fails because the OS won’t accept them.
Workaround: fork, clone in WSL/Linux, delete those files, clone on Windows. I tried sparse checkout, didn't work.
https://github.com/Maxim-Mazurok/chrono