记住密码
git config --global credential.helper store
git config --local credential.helper store
配置commit 用户和邮箱
- 用户配置
git config --local --add user.name "walkerjun"
git config --local --add user.email "yujun2647@163.com"
- 仓库配置(优先级最高)
git config --local --add user.name "walkerjun"
git config --local --add user.email "yujun2647@163.com"
设置多个推送地址
-
添加
git remote set-url --add --push origin https://gitee.com/walkerjun/watchdog.git
git remote set-url --add --push origin https://github.com/yujun2647/watchdog.git
检查 git remote show origin
(venv) walkerjun@walkerjun:~/myPythonCodes/watchdog$ git remote show origin
* 远程 origin
获取地址:https://gitee.com/walkerjun/watchdog.git
推送地址:https://github.com/yujun2647/watchdog.git
推送地址:https://gitee.com/walkerjun/watchdog.git
HEAD 分支:main
远程分支:
dev/feature/camera-restart 已跟踪
main 已跟踪
为 'git pull' 配置的本地分支:
main 与远程 main 合并
为 'git push' 配置的本地引用:
main 推送至 main (最新)
-
删除一个推送地址
git remote set-url --delete --push origin https://gitee.com/walkerjun/watchdog.git