Git: Push a new repository

create a new repository on the command line

echo "# helm-nexus" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/{username}/helm-nexus.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/{username}/helm-nexus.git
git push -u origin master
Advertisements

Git error: fatal: No such remote ‘origin’

Execute the following commands in git bash:

  1.  git remote add origin <url>
  2. git remote set-url –push origin <url>
  3. git push -u origin master