github关联本地项目

时间:2021-03-31

在本地创建新的项目并关联GitHub

echo "# panda" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:xxxx/yyyy.git
git push -u origin main

关联已有本地项目

git remote add origin git@github.com:xxxx/yyyy.git
git branch -M main
git push -u origin main