zoukankan      html  css  js  c++  java
  • git ssh https 踩坑记 ---- 域账号密码更新

    前几天突然通知要更新公司的域账号密码,然后git pull就一直报

    fatal: Authentication failed for 'https://git ...

    很奇怪的是,有一个项目git pull push都是好的。

    上网查了下用以下命令可以看到

    git remote get-url origin

    好的项目是用了ssh不好的项目用的是https,https把旧的密码存到电脑里了,所以一直登陆不上

    解决方法1--修改密码:

    // 清除账户密码缓存
    git config --system --unset credential.helper
    // 设置账户密码永久保存
    git config --global credential.helper store
    // 拉代码,重新输入账号密码登陆一次,以后再也不用再输账号密码
    git pull

    解决方法2--改用ssh方式认证:

    // 去除https源
    git remote remove origin
    // 添加ssh远端源
    git remote add origin git@git.xxx.cn:xxx/xxx.git

     ps: 值得注意的是更换origin后,分支要和远端重新关联一下

    git branch --set-upstream-to=origin/dev
  • 相关阅读:
    python变量和常量
    python运算符
    python 数据类型强制转换
    Python 变量的缓存机制
    Python格式化输出
    Python 自动类型转换
    Python 六大标准基础数据类型
    Python 基础
    pyhton 初识
    计算机基础
  • 原文地址:https://www.cnblogs.com/amiezhang/p/10278854.html
Copyright © 2011-2022 走看看