zoukankan      html  css  js  c++  java
  • git push的时候每次都要输入用户名和密码的问题解决

    • 换了个ssh key,发现每次git push origin master的时候都要输入用户名和密码
    • 原因是在添加远程库的时候使用了https的方式。。所以每次都要用https的方式push到远程库
    • 查看使用的传输协议:
    git remote -v
    
    wuxiao@wuxiao-C-B150M-K-Pro:~/MyGithub/DailyBlog$ git remote -v
    origin https://github.com/toyijiu/DailyBlog.git (fetch)
    origin https://github.com/toyijiu/DailyBlog.git (push)
    
    • 重新设置成ssh的方式:
    git remote rm origin
    git remote add origin git@github.com:username/repository.git
    git push -u origin master
    
    • 再看下当前的传输协议:
      wuxiao@wuxiao-C-B150M-K-Pro:~/MyGithub/DailyBlog$ git remote -v
      origin git@github.com:toyijiu/DailyBlog.git (fetch)
      origin git@github.com:toyijiu/DailyBlog.git (push)
  • 相关阅读:
    C#中Post和Get提交
    C#实现动态页面静态化
    瀑布流的实现
    jQuery常用方法验证
    eclipse配置PHP开发环境
    数据结构学习
    机器学习实战
    Leetcode_StringToInteger
    网络学习
    leetcode_前期心得
  • 原文地址:https://www.cnblogs.com/lxwphp/p/9590511.html
Copyright © 2011-2022 走看看