2

I started a project using the Angular CLI and I know it actually should create a git for me. Typed in the terminal in my project directory:

  1. git add .

  2. git commit -m "some message"

And now I want to push. Where should I push this to? or where is the GitHub generated by the CLI?

Kinda seeing things blurry because I'm not very experienced with git and with Angular CLI.

Thanks for any help!

  • Github != Git - Please see [this SO post](https://stackoverflow.com/questions/13321556/difference-between-git-and-github) to get the difference. – codedge May 04 '20 at 10:03
  • I think it would be best to [start here](https://guides.github.com/introduction/git-handbook/). Angular CLI does not create the remote repository for you. – Michael Doye May 04 '20 at 10:04
  • Sorry for the confusion and thanks, this helped to clear things up –  May 04 '20 at 10:37

1 Answers1

3

Git is a distributed versioning solution, and this causes a lot of misunderstanding at times.

What Angular is doing for you is actually turning your project directory into a git working directory. What this means is that you can now open a CLI and type git <anything> with git actually doing what you are asking it to do. If you didn't ask Angular to do so, you could have open a terminal in your project directory and type git init to get to the same result.

Your git repository can now be linked to one or more remote repositories. These can be on your machine, on a USB stick, on a shared physical drive in your organization, on a CD ROM, on your old MP3 player or even in cloud, for instance on GitHub or BitBucket.

Angular does not create a remote repository for you, only turns your project folder into a local working repository.

You'll have to create a remote repository yourself, then, in your local, link it as remote:

git remote add origin <URL to your remote>

If you are using GitHub, check out their guide.

As this question is getting asked over and over again, I hope this answer would help git newbies to better understand what is going on.

Daemon Painter
  • 3,208
  • 3
  • 29
  • 44