Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clone success, but checkout failed. #2

Open
fdq09eca opened this issue Mar 9, 2023 · 4 comments
Open

clone success, but checkout failed. #2

fdq09eca opened this issue Mar 9, 2023 · 4 comments

Comments

@fdq09eca
Copy link

fdq09eca commented Mar 9, 2023

see error below

> git clone https://github.com/UKDataServiceOpen/Crime_Data_in_R.git
Cloning into 'Crime_Data_in_R'...
remote: Enumerating objects: 978, done.
remote: Counting objects: 100% (199/199), done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 978 (delta 101), reused 114 (delta 44), pack-reused 779
Receiving objects: 100% (978/978), 213.83 MiB | 7.05 MiB/s, done.
Resolving deltas: 100% (335/335), done.
error: invalid path 'March_2023/Webinar /Live Code Demo Slide Deck.pptx'
fatal: 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 :/'

file/folder can be retrieved by git restore --source=HEAD :/

> git restore --source=HEAD :/
error: invalid path 'March_2023/Webinar /Live Code Demo Slide Deck.pptx'
error: invalid path 'March_2023/Webinar /Mapping Crime Data in R Day 1 (03_2023) copy.pptx'

> ls 

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          3/9/2023   9:23 PM                assets
d-----          3/9/2023   9:23 PM                Dec_2021
d-----          3/9/2023   9:23 PM                Feb_2021
d-----          3/9/2023   9:23 PM                June_2022
d-----          3/9/2023   9:23 PM                March_2023
-a----          3/9/2023   9:23 PM            218 Crime_Data_in_R.Rproj
-a----          3/9/2023   9:23 PM            119 environment.yml
-a----          3/9/2023   9:23 PM            135 install.r
-a----          3/9/2023   9:23 PM           1475 README.md
-a----          3/9/2023   9:23 PM             19 runtime.txt

I am on a window machine, I believe the error is because the spaces of the folder/file names

'March_2023/Webinar /Live Code Demo Slide Deck.pptx'
'March_2023/Webinar /Mapping Crime Data in R Day 1 (03_2023) copy.pptx'

@NadiaK98 would you please clean the names? Thank you

@fdq09eca fdq09eca changed the title Cannot clone the repo clone success, but checkout failed. Mar 9, 2023
@NadiaK98
Copy link
Collaborator

Hi, thank you for sharing this error. I believe the issue was due to long file name when working in Git for Windows. I've gone ahead and cleaned the names so please leave another comment if this issue persists.

For future reference, you can circumvent this by running Git Bash as administrator (right-clicking the app shortcut will show the option to Run as Administrator ) and then setting core.longpaths to true as seen here

git config --system core.longpaths true.

Thank You

@hignell
Copy link

hignell commented Feb 14, 2024

Hi @NadiaK98, an error has also occurred when I tried to set up a new project using Git Version Control. the error message was:

error: invalid path 'Feb_2024/Webinar /.DS_Store'
fatal: 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 :/'

UPDATE:
I have now downloaded a zip of the git directly from https://github.com/UKDataServiceOpen/Crime_Data_in_R and I can open the R project within that. Is that a sufficient workaround for the workshop?

@NadiaK98
Copy link
Collaborator

Hi, sorry for the delayed response! Thank you for pointing out that error with the .DS_store files. These were accidentally committed to the repository but have now been removed and cloning should work. Downloading the content as a zip file also works, you will still be able to follow along with the content but make sure to have downloaded the most recent repo since changes have been made!

@hignell
Copy link

hignell commented Feb 15, 2024

Thank you @NadiaK98. I have just attempted the clone the repository again and I got the following error:

error: invalid path 'Feb_2024/Webinar /MCDR_Menti_Results_Session1_2024.pdf'
fatal: 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 will download the zip file again before the session tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants