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

[root@iZ25mi9h7ayZ ~]# git config --global credential.helper store

2、执行之后会在.gitconfig文件中多加红色字体项

[user]
name = wang
email = xxxx@xxxx.com
[credential]
helper = store

3、之后cd到项目目录,执行git pull命令,会提示输入账号密码。输完这一次以后就不再需要,并且会在根目录生成一个.git-credentials文件

[root@iZ25mi9h7ayZ test]# git pull
Username for 'https://git.oschina.net': xxxx@xxxx.com
Password for 'https://xxxx@xxxx.com@git.oschina.net':
[root@iZ25mi9h7ayZ ~]# cat .git-credentials
https://Username:Password@git.selfgit.net

4、之后pull/push代码都不再需要输入账号密码了~

 
 

linux服务器git pull/push时避免频繁输入账号密码的更多相关文章

  1. linux服务器git pull/push时提示输入账号密码之免除设置

    1.先cd到根目录,执行git config --global credential.helper store命令 [root@iZ25mi9h7ayZ ~]# git config --global ...

  2. linux git pull/push时提示输入账号密码之免除设置

    1.先cd到根目录,执行git config --global credential.helper store命令 [root@iZ25mi9h7ayZ ~]# git config --global ...

  3. git pull push 不用输入用户名和密码的方法

    1.在计算机的安装盘下找到 '用户' 这个文件夹打开. 2.找到'用户' 文件夹下面你当前的用户. 3.新建'.gitconfig' 文件 4. [user] email =  name = [pus ...

  4. 使用 expect 重启失败的 git pull/push 操作

    问题的提出 最近使用 github 上传.下载项目代码时,经常会卡很久,有时候在命令行打了 git push 然后就去上厕所了,结果等我回来的时候,发现 push 早已经失败了,还得重新提交一下.如果 ...

  5. 解决git pull/push每次都需要输入密码问题 和 HttpRequestException encountered

    如果我们git clone的下载代码的时候是连接的https://而不是git@git (ssh)的形式,当我们操作git pull/push到远程的时候,总是提示我们输入账号和密码才能操作成功,频繁 ...

  6. git pull文件时和本地文件冲突的问题

    在使用git pull代码时,经常会碰到有冲突的情况,提示如下信息: error: Your local changes to 'c/environ.c' would be overwritten b ...

  7. 使用git pull文件时和本地文件冲突怎么办?

    同事在使用git pull代码时,经常会碰到有冲突的情况,提示如下信息: error: Your local changes to 'c/environ.c' would be overwritten ...

  8. 使用git pull文件时和本地文件冲突怎么办

    在使用git pull代码时,经常会碰到有冲突的情况,提示如下信息:error: Your local changes to 'c/environ.c' would be overwritten by ...

  9. git需要设置再次弹出输入账号密码

    今天在用命令行pull线上代码到本地时遇到一个尴尬的问题,因为新下载的git貌似默认了在pull,push代码时只弹出一次输入账号密码,反正我这里是这样的. 开始在pull线上代码的时候不小心密码输错 ...

随机推荐

  1. Ajax GET

    $ajax的post请求提交方式: Controller: @RequestMapping("/emps") @ResponseBody public Msg getEmps(@R ...

  2. SDUT OJ 数据结构实验之二叉树六:哈夫曼编码

    数据结构实验之二叉树六:哈夫曼编码 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descr ...

  3. c#Udp分包组包方法

    udp通信协议,相信大家都知道这个.由于是无连接的协议,所有udp的传输效率比tcp高.但是udp协议传输较大的数据文件得分包 最近写了个分包组包的方法,拿来和大家分享,如果有什么不妥的地方,欢迎点评 ...

  4. CentOS 7 安装中网络设置111

    如果在安装过程中需要使用网络,需要启动网卡,默认是DHCP 点击configure进入设置 General 常规设置 Automatically connect to this network whe ...

  5. Foremost恢复Linux中已删除的文件

    Foremost 我们只能在Linux中恢复已删除的文件,只要这些扇区在硬盘上没有被覆盖. 首先安装 要在CentOS上安装Foremost,我们将从官方网页下载并安装最前面的rpm.打开终端并执行以 ...

  6. liunx 安装 phpstudy

    phpStudy Linux版&Win版同步上线 支持Apache/Nginx/Tengine/Lighttpd/IIS7/8/6 phpStudy for Linux 支持Apache/Ng ...

  7. C++_代码重用1-总览

    C++的主要目的是促进代码重用. 公有继承是实现这一目标的机制之一: 本身是另一个类的成员,这种方法称为包含.组合.层次化. 另一种方法是使用私有.保护继承. 通常包含.私有继承和保护继承用于实现ha ...

  8. 洛谷 P2486 [SDOI2011]染色(树链剖分+线段树)

    题目链接 题解 比较裸的树链剖分 好像树链剖分的题都很裸 线段树中维护一个区间最左和最右的颜色,和答案 合并判断一下中间一段就可以了 比较考验代码能力 Code #include<bits/st ...

  9. UVA - 10635 LIS LCS转换

    白书例题,元素互不相同通过哈希转换为LIS求LCS #include<iostream> #include<algorithm> #include<cstdio> ...

  10. 关于jstl taglib的错误 Can not find the tag library descriptor for “http://java.sun.com/jstl/core”

    在查了N个帖子之后,决定记录一下关于jstl taglib的配置方法. 首先我遇到的错误是: Can not find the tag library descriptor for "htt ...