Init fails on initalizing git repo
When running the documented command to create a new project:
uvx --from git+https://github.com/github/spec-kit.git specify init test
the initialization process gets to the "Initialize git repository" step and hangs for several minutes before giving up with an "init failed" message.
Environment:
- Windows WSL2 (full Ubuntu VM, Linux dev 5.15.137.3-microsoft-standard-WSL2)
- Model/Agent: Claude Pro (Subscription)
I notice from the prereqs, I'm only on Python v3.10.12 and v3.11+ is required.
EDIT: Updated to Ubuntu v24 in WSL2 VM, now running Python v3.12. Now I'm unable to get through initial step with git failing:
➜ dev uvx --from git+https://github.com/github/spec-kit.git specify init test
Updating https://github.com/github/spec-kit.git (HEAD) × Failed to resolve `--with` requirement
╰─▶ Git operation failed
EDIT 2: The above git failure was due to no DNS configuration. /etc/resolv.conf was removed during Ubuntu upgrade from v22 -> v24
EDIT 3: And now after restoring DNS, I'm back to the initial issue: init hangs on "Initialize git repository" until it fails several minutes later
Following AI's advice, I was able to build spec-kit/specify manually first and then use the command directly rather then via the --from mehod.
I followed the following steps:
# 1. Clone the repository
git clone https://github.com/github/spec-kit.git
cd spec-kit
# 2. Install PDM (if you don't have it)
uv pip install pdm
# 3. Let PDM create the environment and install all dependencies
pdm install
# 4. Run your command using PDM's runner
pdm run specify init test
NB: In the middle, I needed to create venv and source it, then pdm binary was properly linked and could be used in the pdm install command. Missing that step results in error command not found: pdm.
Using this method, the test folder was correctly initialized as expected.
I'll leave this issue open until someone can determine if this is a bug and should be triaged, but I'm no longer blocked.
I ran into the same error trying to initialize the git repository. I looked at the code for init_git_repo and tried to manually run the commands which are:
git initgit add .git commit -m "Initial commit from Specify template"
Step 3 failed because I'm on a new computer and hadn't set up my git user. It prompted me to do the following:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
Once I did that step 3 worked. Also, I tested on a new specify project and it ran successfully once my git user was configured.
All of that to say, your exact git error might be different, but manually running those steps will show you what the actual error is.
This is actually really good feedback, folks - thank you. Looks like I need to be more verbose about Git errors and how they show up within the CLI itself.
This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.
This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.