Nov 10, 2018

How push to new repository in Git

$ git remote add origin
fatal: remote origin already exists.

$ git remote rm origin
$ git remote add origin
$ git push -u origin master

In the above, you remove the existing remote repository first. "origin" is the local name of the remote repository. You can use the other name like:

git remote add anotherName