一、生成秘钥,并配置 config 文件
二、配置脚本文件,切换远程仓库地址,并提交。
// github.sh
git remote rm origin
git remote add origin git@github.com:xxx/yyy.git
git push origin master
// gitee.sh
git remote rm origin
git remote add origin git@gitee.com::xxx/yyy.git
git push origin master
三、使用
// 初始化
git init
// 查看状态
git status
// 将更改提交到本地仓库
git add .
git commit -m "备注信息"
// 提交前先把最新文件拉下来
git pull origin master
// 切换远程仓库地址,并将代码提交到远程仓库
sh github.sh 或者 sh gitee.sh