首次上传:
1. 你有一个github账号,并新建一个repository,得到ssh/https网址。
2.找到需要上传的项目文件夹的根目录,右键Git Base Here
输入:ssh-keygen -t rsa -C "your_email@qq.com",一路回车+y,生成一个小图案密钥。
cat ~/.ssh/id_rsa.pub 可以查看生成的密钥,
将其复制到:github个人主页—>设置—>SSH and GPG keys—>New SSH key
3.依次执行:
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:xmu-ls/IMC.git
git push -u origin main
二次添加文件:
git add newfile
git commit -m "add newfile"
git pull --rebase origin main
git push -u origin main