create new github repository from command line code example

Example 1: git add existing project to repository

git remote add origin 
git branch -M main
git push -u origin main

Example 2: how to create new repository in github

git init
• git add .
• git commit -m "first commit"
• git remote add
            origin https://github.com/sd1511/FinraDeck.git
• git push -u origin master

Example 3: create new repository on the command line

git init
git add README.MD
git commit -m "commit message"
git remote add origin git url_of_github_repo
git push origin master

Example 4: initialize a repo and push to github

git init
git add -A
git commit -m 'Added my project'
git remote add origin [email protected]:sammy/my-new-project.git
git push -u -f origin master

Tags: