Skip to content

fix: Do not init git if inside git repo#144

Merged
OS-pedrogustavobilro merged 2 commits intomainfrom
fix/git-init-inside-git-repo
Mar 2, 2026
Merged

fix: Do not init git if inside git repo#144
OS-pedrogustavobilro merged 2 commits intomainfrom
fix/git-init-inside-git-repo

Conversation

@OS-pedrogustavobilro
Copy link
Contributor

Fixes #27

⚠️ AI-assisted PR with claude code, manually verified and tested by me.

I was hitting this issue several times recently, and got annoyed so fixed it. Before trying to run git init, we run another git command with --is-inside-work-tree to check if the plugin directory is already in a git repo (e.g. this can be the case for monorepos)

It can be argued that this isn't an issue, but imo it's more often than not, you don't want to create a git repo inside another git repo. Users can still run git init afterwards if they choose, but this package shouldn't make that decision for them.

@OS-pedrogustavobilro OS-pedrogustavobilro requested a review from a team March 2, 2026 11:04
@OS-pedrogustavobilro OS-pedrogustavobilro merged commit 6b01f77 into main Mar 2, 2026
4 checks passed
@OS-pedrogustavobilro OS-pedrogustavobilro deleted the fix/git-init-inside-git-repo branch March 2, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not run git init when already in a git repo

2 participants