For context: the CLI actually copies your repo into a temporary directory before running the Git commands from there. This error looks a bit unusual, so I made a special debug build of the CLI that logs extra info.
Could you please run it and share the output? Here’s how:
Clone the repo:git clone https://github.com/codecrafters-io/cli && cd cli
Checkout the debug branch:git checkout andy/debug-temp-branch
Re-install the CLI:make install
Once you’ve run the same command again, could you please paste the full output? Thanks!
FYI, here’s what the extra logs look on my machine:
No CodeCrafters git remotes found. Available remotes: ``https://github.com/codecrafters-io/cli Please run this command from within your CodeCrafters Git repository.
Looks like you ran codecrafters test inside the cli repo. Could you try running it from within ~/projects/edu/codecrafters/codecrafters-shell-go and sharing the output again? Thanks!
Could you try deleting the existing codecrafters binary, reinstall the debug build from the andy/debug-temp-branch branch, and then run codecrafters test again inside your challenge repo? Thanks!
⛳ localGitIgnore path: /Users/aurora/projects/edu/codecrafters/codecrafters-shell-go/.gitignore
⛳ localGitIgnore content:
Created by https://www.gitignore.io
Go
If you prefer the allow list template instead of the deny list, see community template:
Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
Test binary, built with go test -c
*.test
Output of the go coverage tool, specifically when used with LiteIDE
*.out
Dependency directories (remove the comment below to include it)
vendor/
Go workspace file
go.work
.pre-commit-config.yaml
⛳ globalGitIgnore path: /Users/aurora/configs/gitignore
⛳ globalGitIgnore content:
.git
*.git
_t.
*t.
t_.
tmp/
*tmp/
tmp*/
.history/
tasks.md
.side/
.DS_Store
⛳ gitInfoExclude path: /Users/aurora/projects/edu/codecrafters/codecrafters-shell-go/.git/info/exclude
⛳ gitInfoExclude content:
git ls-files --others --exclude-from=.git/info/exclude
Lines that start with ‘#’ are comments.
For a project mostly in C, the following would be a good set of
exclude patterns (uncomment them if you want to use them):
*.[oa]
*~
⛳ before copy:
⛳ ls -la /var/folders/5b/kdgjkkvs0ml237190ytvlcq40000gn/T/codecrafters4081131857 : total 0
drwx------@ 2 aurora staff 64 Jan 13 16:54 .
drwx------@ 1770 aurora staff 56640 Jan 13 16:54 ..
⛳ after copy:
⛳ ls -la /var/folders/5b/kdgjkkvs0ml237190ytvlcq40000gn/T/codecrafters4081131857 : total 1328
drwxr-xr-x@ 20 aurora staff 640 Jan 13 16:54 .
drwx------@ 1770 aurora staff 56640 Jan 13 16:54 ..
drwxr-xr-x@ 4 aurora staff 128 Jan 13 16:54 .codecrafters
-rw-r–r–@ 1 aurora staff 12 Jan 13 16:54 .gitattributes
-rw-r–r–@ 1 aurora staff 556 Jan 13 16:54 .gitignore
drwxr-xr-x@ 3 aurora staff 96 Jan 13 16:54 .vscode
drwxr-xr-x@ 3 aurora staff 96 Jan 13 16:54 app
-rw-r–r–@ 1 aurora staff 281 Jan 13 16:54 codecrafters.yml
-rw-r–r–@ 1 aurora staff 62 Jan 13 16:54 go.mod
-rw-r–r–@ 1 aurora staff 0 Jan 13 16:54 go.sum
-rw-r–r–@ 1 aurora staff 1359 Jan 13 16:54 README.md
-rwxr-xr-x@ 1 aurora staff 773 Jan 13 16:54 your_program.sh
create temp branch: run git command: fatal: not a git repository (or any of the parent directories): .git
. Error: exit status 128
Those patterns are a bit unusual since Git treats .git/ specially, and it ends up interfering with our CLI, which relies on the .git/ directory being present to interact with the repository correctly.
Removing these lines from your global gitignore should resolve the issue. Let me know how it goes!