Next.js Discord

Discord Forum

How to not create .git when initializing a new project?

Answered
Shayokh posted this in #help-forum
Open in Discord
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.
View full answer

26 Replies

iirc there was a --no-git flag
but you can just delete the .git dir
@@ts-ignore but you can just delete the `.git` dir
I have been doing this so far. But this manual work is kinda annoying
@@ts-ignore iirc there was a `--no-git` flag
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-app
It seems that unfortunately, you'd either have to do this manually, or append with another command to delete .git afterwards
@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 :meow_coffee:
@Shayokh https://github.com/vercel/next.js/discussions/67748
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 :)
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
@Shayokh congratulations
Np, we finally got it done