如果还没配置过,需要配置账号信息
git config --global user.name "baymax-collab"
git config --global user.email "baymax-collab@test.com"
创建一个新的存储库
git clone git@github.com:xxxx
cd test
git switch --create main
touch README.md
git add README.md
git commit -m "add README"
git push --set-upstream origin main
推送一个已有的文件夹
cd existing_folder
git init --initial-branch=main
git remote add origin git@github.com:xxx
git add .
git commit -m "Initial commit"
git push --set-upstream origin main
推送一个现有的Git存储库
cd existing_repo
git remote rename origin old-origin
git remote add origin git@github.com:xxxx
git push --set-upstream origin --all
git push --set-upstream origin --tags