how to use git on command line code example

Example 1: how to login to git from terminal

git config --global user.name "your_username"

Example 2: how to login to git from terminal

git config --global user.email "[email protected]"

Example 3: git basic command tutorial

#Initialize Repo
cd my_awesome_project
git init
#NOTE:you need to setup your global (--global) or project user
git config --global user.name POG
git config --global user.email [email protected]
#Create a README.md and .gitignore file then stage all changes
git add .
#Commit them
git commit -m "Create REAME and gitignore"

Example 4: how to use git in terminal

create new repo-git
echo "# SqlMentor" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin
https://github.com/asd/SqlMentor.git git push -u origin
master
push an existing repo-git
git remote add originhttps://github.com/asd/SqlMentor.git
git push -u origin master
Default editor