CodeCrafters CLI error running tests

I get an error when run codecrafters test:

create temp branch: add all files: fatal: not a git repository (or any of the parent directories): .git

but actually this folder is a git repository and .git exists.

ls output:

total 40
drwxr-xr-x@ 11 aurora  staff   352 Jun  6 21:23 .
drwxr-xr-x   5 aurora  staff   160 Jun  6 13:19 ..
drwxr-xr-x@  4 aurora  staff   128 Jun  6 13:19 .codecrafters
drwxr-xr-x@ 14 aurora  staff   448 Jun  7 11:45 .git
-rw-r--r--@  1 aurora  staff    12 Jun  6 13:19 .gitattributes
drwxr-xr-x@  3 aurora  staff    96 Jun  6 21:58 app
-rw-r--r--@  1 aurora  staff   281 Jun  6 21:00 codecrafters.yml
-rw-r--r--@  1 aurora  staff    62 Jun  6 13:19 go.mod
-rw-r--r--@  1 aurora  staff     0 Jun  6 13:19 go.sum
-rw-r--r--@  1 aurora  staff  1359 Jun  6 13:19 README.md
-rwxr-xr-x@  1 aurora  staff   773 Jun  6 13:19 your_program.sh

MacOS Sequoia 15.5

Thank you!

Hey @kravlad, could you share the contents of your .git directory? It might be corrupted.

It should look something like this:

Also, could you run git status and share the output?

Hi andy1li, thanks for your reply.

It doesn’t look that git directory might be corrupted. I did git clone just a day ago and did nothing except git commit and git push.

Anyway, below requested outputs:



@kravlad Would you mind zipping your repo and sending it to “hello at codecrafters.io”?

Sure, already sent from kravlad86 at gmail

I’ve received your repo, but couldn’t reproduce the error when running codecrafters test.

Could you try the following to see if it resolves the issue on your end?

  • Reinstall the CLI
brew reinstall codecrafters-io/tap/codecrafters
  • Re-clone the repo

No, nothing of those helped