linux下使用git来pull和push时免输账号密码
2017-12-10 00:00
861 查看
在linux环境下将github上的代码pull下来或者将本地代码push到github上时,每次都需要输入账号密码,很麻烦!有什么方法能不输入呢!
1.配置ssh(此处不介绍)
2.增加配置文件
cd到根目录下,执行git config --global credential.helper store命令
正常push你的项目代码或pull一次,这一次还是要求你输入账号和密码的。此时根目录下又会生成一个.git-credentials文件,这里面就保存了你的账号和密码信息,可以通过cat查看
之后你再pull或push就不再需要输入账号密码咯!
ssh配置不成功的同学可以尝试这种方法哦!
1.配置ssh(此处不介绍)
2.增加配置文件
cd到根目录下,执行git config --global credential.helper store命令
$ cd /root/ $ git config --global credential.helper store $ ll 总用量 112 ... -rw-r--r-- 1 root root 81 12月 10 14:47 .gitconfig ...此时目录下会增加一个.gitconfig文件,这里面就会保存你的账号和用户名等信息。
正常push你的项目代码或pull一次,这一次还是要求你输入账号和密码的。此时根目录下又会生成一个.git-credentials文件,这里面就保存了你的账号和密码信息,可以通过cat查看
$ ll 总用量 116 ... -rw-r--r-- 1 root root 81 12月 10 15:07 .gitconfig -rw------- 1 root root 39 12月 10 14:49 .git-credentials ...
之后你再pull或push就不再需要输入账号密码咯!
ssh配置不成功的同学可以尝试这种方法哦!
相关文章推荐
- linux下,每次git pull 或者git push都需要输入账号密码的问题以及git remote 的一些基本操作
- linux git pull/push时提示输入账号密码之免除设置
- linux git push pull免账号密码
- linux服务器git pull/push时避免频繁输入账号密码
- git pull/push时提示输入账号密码之免除设置
- linux服务器git pull/push时提示输入账号密码之免除设置
- git本地免密码和账号pull、push
- 解决git 每次使用都需要输入账号密码 ( Windows和linux)
- 添加码云上的SSH公钥以及解决使用命令git pull/push 输入密码问题
- git使用push或者pull命令每次都需要输入用户名和密码?
- git 每一次pull或者push的时候,都需要输入密码和账号
- git pull/push时候总提示输入账号密码 - 免除设置
- 在使用Git push或pull代码的时候,总是要输入用户名和密码的问题
- git pull/push时候总提示输入账号密码 - 免除设置
- git pull/push项目的时候总是提示要输入用户名密码的解决方案
- 02_创建Git仓库,克隆仓库,git add,git commit,git push,git pull,同行冲突,不同行冲突的结局方案,git mergetool的使用
- 使用SSH方式免去Git每次push都输入用户名和密码
- git push github 远程仓库 要求每次输入账号密码问题
- Windows下使用git push命令的无密码设置
- git无需密码进行push/pull