Files
skillshare/cmd
Willie 593bcabf2e fix: defer git initial commit to after skill installation
doGitInit() previously committed immediately (only .gitignore), but
installSkillIfNeeded() runs later — leaving skill files uncommitted.
This caused "Local changes detected" on first pull.

Move commit to a single commitSourceFiles() call at the end of init,
after all files are in place. Covers all scenarios:

performFreshInit (first-time init):
- No remote, no skill → 1 commit: "Initial commit" (.gitignore)
- No remote, with skill → 1 commit: "Initial skills" (.gitignore + skill)
- Remote empty → same as above, remote fetch is no-op
- Remote has skills → reset --hard to remote; commitSourceFiles is no-op
- Remote unreachable → same as no-remote (fetch fails gracefully)

handleExistingInit (init --remote on existing config):
- Git exists → commitSourceFiles is no-op (already committed)
- Git not exists, remote reachable → commit before setupGitRemote so
  HEAD exists for reset --hard
- Git not exists, remote unreachable → commit .gitignore so push/pull
  don't see "Local changes detected"
2026-02-22 08:08:35 +08:00
..