Chapter 5 Git

5.1 Initial

git init
git add . 
git commit -m "first commit"

5.1.1 After remote Repository

  1. empty Repository in local
echo "# name" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:LuckyKanLei/Suisong.git
git push -u origin main
  1. alredy a local Repository
git remote add origin git@github.com:LuckyKanLei/Suisong.git
git branch -M main
git push -u origin main

5.1.2 Push to a new remote Repository

git push origin main:Kan

main: the local Repositoryry

Kan: the remote Repositoryry, if empty, it will new build