0

When pulling the repo from gitlab i get the following error:
warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/'

Running the command:
git restore --source=HEAD :/
produces:
-global is not a valid attribute name: .gitattributes:2 error: unable to create file [filename_redacted]: Filename too long

.gitattributes line 2 looks like this:
$ git config --global core.autocrlf true

When I edit it out of the .gitattributes, it auto-reappears.
When I issue git status I'm getting all the files from the repo as edited. Standard commands as git reset don't do any good either.
Is there anything I can do with this repo to make it work properly?
Should I ask the repo owner/someone who has it pulled and working to fix it before pulling it again? How?

Lol
  • 37
  • 5
  • 1
    Found this post that may be related: https://stackoverflow.com/questions/22041752/github-clone-succeeded-but-checkout-failed – user15002649 May 09 '23 at 04:37
  • I've seen this post. I issued the command to fix long filenames but I'm still getting the errors. – Lol May 09 '23 at 04:39

1 Answers1

1

Can I ask what OS are you using? If you have windows looks like it doesn't let you pass some filename formats:

Found another post using git config --global core.symlinks false for a work around, hope it can work: Why is clone succeeded, but checkout failed?

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
  • I use windows. I tried the solution with git hooks and I'm still getting the error: `-global is not a valid attribute name: .gitattributes:2` – Lol May 09 '23 at 05:39
  • 1
    Found another post using ```git config --global core.symlinks false``` for a work around, hope it can work: https://stackoverflow.com/questions/70540664/why-is-clone-succeeded-but-checkout-failed – user15002649 May 09 '23 at 06:28
  • It worked! I can use the repo now – Lol May 09 '23 at 06:53
  • Glad it can help! Yay! – user15002649 May 09 '23 at 15:04