Git basics

I'm not a git expert, sometimes I need a reminder when setting up a new repository of the commands necessary.

Creating a new repository on the command line

touch README.md
git init

git add README.md
git commit -m "Initial commit"
git remote add origin https://<url to repository>.git
git push -u origin master

Pushing an existing repository from the command line

git remote add origin https://<url to repository>.git
git push -u origin master

Previous Post Next Post

Add a comment