目录
1、查看当前属于什么地址的命令
- 1、查看当前属于什么地址的命令
- 2、从ssh切换至https
- 3、从https切换至ssh
- 4、设置密码
git remote -v
如果当前处于ssh状态下会输出一下内容。
origin git@gitee.com:mssj200224/open-resources.git (fetch) origin git@gitee.com:mssj200224/open-resources.git (push)
如果当前处于https状态下会输出一下内容。
origin https://git@gitee.com:mssj200224/open-resources.git (fetch) origin https://git@gitee.com:mssj200224/open-resources.git (push)2、从ssh切换至https
git remote set-url origin https://git@gitee.com:mssj200224/open-resources.git
origin后面是远程仓库的https地址。
3、从https切换至sshgit remote set-url origin git@gitee.com:mssj200224/open-resources.git
origin后面是远程仓库ssh地址。
4、设置密码默认15分钟
git config --global credential.helper cache
自己定义时间,一小时后失效
git config credential.helper 'cache --timeout=3600'
永久存储密码
git config --global credential.helper store