git的使用
连接
- 本地生成公钥
ssh-keygen -t rsa -C "邮箱地址"
位置在:/Users/hangshao/.ssh
- 复制公钥并在github上设置
- 测试连接
ssh -T [email protected]
上传
新仓库
echo "# Test">> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Hang-shao/Test.git
git push -u origin main
旧仓库
git remote add origin https://github.com/Hang-shao/Test.git
git branch -M main
git push -u origin main
标签:origin,git,add,github,使用,Test,main
From: https://www.cnblogs.com/pam-sh/p/16751470.html