How to create an angular project without Initial commit?

Asked

Viewed 141 times

0

As there is no example in the documentation of angular.io, I can’t start a project without it running an Initial commit, according to options in the documentation, I tried several ways and nothing, always creates!

--commit=true|false                 

Initial git repository commit information.

Default: true
  • Interesting fact: why is it a problem to have this initial commit? Have you tried deleting the Git folder and creating the repository again?

  • So, it’s because I like using Git Flow, so I’d like to start with it.

  • I saw that I can exclude the . git, but since there is an option in the documentation, I would like it to work, because any project that did would have to delete . git always!

1 answer

0

To not execute the initial commmit just add to the command the attribute '-commit=false'

ng new <nome-app> --commit=false

It will create the repository, but will not commit. You can check this by entering the project folder and using the git log command and it will error 'fatal: your Current branch 'master' does not have any commits yet'

It is well described in the documentation of angular io.

But if you didn’t want to use git in the project, then just delete the '.git' folder inside the project directory. However, I don’t recommend deleting the git folder and also leave the initial commit running, since it doesn’t interfere with the workflow.

  • So Maikon, as I said before I tried in every way, including this way that you put an error saying that I have to follow the pattern in JSON, so I did in {"commit": "false", "style": "scss", etc.} and executed, but the commit keeps being done!

  • I ran everything from 0, installed @angular/cli, then ran the ng new <name> -commit=false command and he created the project without doing the first commit, just by adding the files to the tree. I also executed the creation of another project using the angular pattern and it committed. Checks the steps of creating your project again, by following the documentation the command works. The first commit doesn’t interfere with anything in your workflow, as I see it, you don’t need to add the --commit=false command even using Git Flow.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.