git clone <>
# 将要push的文件放入clone的位置
cd <dir>
git init
git add .
git commit -m "first commit"
git remote remove origin
# clone的地址中间加个token@,token密钥需要在github的settings/Developer settings中申请
git remote add origin https://<token>@<github地址>
# 注意观察如果不是main分支而是master分支的话,使用下面命令切换分支
git branch -M main
# 上传到github默认分支 main 中
git push -u origin main
github上传代码(2022年精简版)
最新推荐文章于 2024-03-31 10:00:00 发布