文章目录
设置git
首先需要告诉git你的身份
git config --global user.email "you@example.com"
git config --global user.name "xxxxx"
需要补充github账号注册的邮箱地址以及用户名
修改远程项目url
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
提交更新
向本地仓库提交文件夹或者文件
git add <dir>
or
git add <file>
提交到远程仓库
git commit -m "<description>"
git push origin master # git push <远程仓库名>:<分支名>
将本地仓库中更新的文件提交到远程仓库,"<description>"是这一批提交的统一描述。接着推向对应的远程仓库的分支。
如果git push origin master失败,参考【突发】解决remote: Support for password authentication was removed on August 13, 2021. Please use a perso
编辑respository
换repository
git remote set-url origin URL # 更换远程仓库地址,URL为新地址
ie. git remote set-url origin git@github.com:Snowleopard-bin/scripts.git
删除现有repository
git remote rm origin
添加新的远程repository
git remote add origin url
查看远程repository
git remote -v