How to not create .git when initializing a new project?
Answered
Shayokh posted this in #help-forum
ShayokhOP
Whenever I create a new project using create-next-app, it generate a .git along with the project files. How do I disable generating a .git file?
Answered by Arinji
@Shayokh https://github.com/vercel/next.js/discussions/67748
Would appreciate if you could write a comment in there with your situation.
Would appreciate if you could write a comment in there with your situation.
26 Replies
iirc there was a
--no-git flagbut you can just delete the
.git dir@@ts-ignore but you can just delete the `.git` dir
ShayokhOP
I have been doing this so far. But this manual work is kinda annoying
@@ts-ignore iirc there was a `--no-git` flag
ShayokhOP
Okay let me try
Didn't work. Tried this -
npx create-next-app@latest ./ --no-git@@ts-ignore iirc there was a `--no-git` flag
--no-git is not a valid flag, see npx create-next-app@latest --help or https://nextjs.org/docs/app/api-reference/create-next-appIt seems that unfortunately, you'd either have to do this manually, or append with another command to delete
.git afterwards@Spinge Bib Sqorpnts `--no-git` is not a valid flag, see `npx create-next-app@latest --help` or https://nextjs.org/docs/app/api-reference/create-next-app
ShayokhOP
I think it would be useful if NextJs team added such a flag in the next update.
@Shayokh I think it would be useful if NextJs team added such a flag in the next update.
Feel free to open a feature request or contribute yourself
I am thinking of making a pr for an update to the flag
If you don't mind, can I ping you once I make it and you can like.. agree to the changes or smthn similar to show the team it's needed.
I have made a few pr's before and having some public opinion always helps out 

@Shayokh https://github.com/vercel/next.js/discussions/67748
Would appreciate if you could write a comment in there with your situation.
Would appreciate if you could write a comment in there with your situation.
Answer
Thankyou, now let's wait for a contributor to go through the proposal :)
@Arinji Thankyou, now let's wait for a contributor to go through the proposal :)
ShayokhOP
I think its a valid feature
They will likely add it
Maybe a flag or option
both works
@Shayokh mark the discussion as the answer, nextjs team will go through it when they get the time
@Shayokh Just waned to let you know, made the PR for it :D
https://github.com/vercel/next.js/pull/68821
Now lets see if they approve it
https://github.com/vercel/next.js/pull/68821
Now lets see if they approve it
Np, we finally got it done