美文网首页
Git免密pull、push

Git免密pull、push

作者: 迷失的信徒 | 来源:发表于2020-10-22 17:55 被阅读0次
  • 设置机制密码(默认15分钟)
git config --global credential.helper cache
  • 自己设置时间
git config credential.helper 'cache --timeout=3600'

这样的设置密码会在一个小时候失效

  • 长期存储密码(推荐)
git config --global credential.helper store
http://yourname:password@git.oschina.net/name/project.git

补充:使用客户端也可以存储密码
如果你正在使用ssh而且想体验https带来的高速,那么你可以这样做: 切换到项目目录下 :

cd projectfile/

移除远程ssh方式的仓库地址

git remote rm origin

增加https远程仓库地址

git remote add origin http://yourname:password@git.oschina.net/name/project.git

http

1、在命令行输入 git config --global credentail.helper store
2、接着在命令行 git pull 拉去代码,此时需要输入密码
3、再往后的操作 pull push 都不用在输入密码

https需要增加凭据管理器

     1、建立凭据文件  ```$ touch ~/.git-credentials```
     2、在文件中加入带凭据的url信息  https://HAliyuxin:(冒号后面输入密码)@github.com
     3、 告诉git使用该凭据  $ git config --global credential.helper store
     4、执行完上面命令会在git配置文件 ~/.gitconfig 中设置一个凭据地址 

    [credential]
      helper = store

参考:https://www.cnblogs.com/lyxzxp/p/13559269.html
https://blog.csdn.net/qq_35845964/article/details/105126353

相关文章

  • Git免密pull、push

    设置机制密码(默认15分钟) 自己设置时间 这样的设置密码会在一个小时候失效 长期存储密码(推荐) 补充:使用客户...

  • GIT的HTTP方式免密pull、push

    Linux或者Mac下方法: 基本步骤和上面类似,就是linux下面可以直接创建.git-credential文件...

  • git pull和push时的免密操作

    因为环境转移的原因,重新搭建了环境。重新装了git环境。安装就不说了,主要说下在pull和push时免密的操作。第...

  • git免密push

    前言 每次提交都要输入密码,是一件相当痛苦的事情。在这里,我们可以尝试一些操作,去掉这个步骤 方法一、配置文件 使...

  • git push 免密

    window环境 在windows中添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%...

  • git 免密码push pull

    在oschina上托管代码的时候每次push都需要输入用户名和密码,是一件非常麻烦的事情,下面介绍两种非常简单的方...

  • git常用记录

    1、git免密码pull,push (1) 首先我们找到用户目录(C:\用户\Administrator)下的.g...

  • coding.net使用git

    pull 本机git版本 push git push origin master 如果报错,使用git push ...

  • ssh 登录保存git账号密码 Git 免密码操作

    每次使用 git pull 或者 git push ,需要输入用户名和密码,工作效率低,以下命令可以实现永久免登陆:

  • git pull/push时免密码

    1、先cd到根目录,执行git config --global credential.helper store命令...

网友评论

      本文标题:Git免密pull、push

      本文链接:https://www.haomeiwen.com/subject/epdpmktx.html