解决每次git pull需要不用输入用户名信息

简介: 解决每次git pull需要不用输入用户名信息

问题描述



在服务器上每次执行git pull,都提示输入用户名和密码


现象分析



我们在git clone工程时有2中形式 https 和git@git。当你使用前者拉取工程时每次都需要输入用户名和密码


解决方案



1.执行下面命令


git config --global credential.helper store


这个时候~/.gitconfig文件中会多一行


[credential]
helper = store


2.执行git pull再次输入用户名和密码


此时你会看到/root/.git-credentials中会多一行内容。里面的内容类似https://{username}:{password}@github.com这种形式


目录
相关文章
|
1月前
|
开发工具 数据安全/隐私保护 git
Git切换本地用户名,IDEA集成Git如何切换本地用户名
Git切换本地用户名,IDEA集成Git如何切换本地用户名
56 3
|
1月前
|
开发工具 git 开发者
Git Pull vs. Git Fetch:深度解析
【2月更文挑战第29天】
728 0
Git Pull vs. Git Fetch:深度解析
|
1月前
|
开发工具 git 开发者
|
14天前
|
存储 开发工具 git
解决“hint: the same ref. If you want to integrate the remote changes, usehint: ‘git pull‘ before pus”
解决“hint: the same ref. If you want to integrate the remote changes, usehint: ‘git pull‘ before pus”
|
20天前
|
缓存 开发工具 数据安全/隐私保护
mac git命令行操作 git push pull 逻辑
mac git命令行操作 git push pull 逻辑
13 1
|
1月前
|
开发工具 git
git pull之后出现REBASE(1/1)
git pull之后出现REBASE(1/1)
33 3
|
1月前
|
开发工具 数据安全/隐私保护 C++
vs2019中同步到github上的用户名错误_控制面板和vs的git全局设置重新登录
vs2019中同步到github上的用户名错误_控制面板和vs的git全局设置重新登录
23 0
|
1月前
|
存储 网络安全 数据处理
git远程操作,推送【push】,拉取【pull】,忽略特殊文件,配置别名,标签管理
git远程操作,推送【push】,拉取【pull】,忽略特殊文件,配置别名,标签管理
|
1月前
|
开发工具 git
git 如何为不同的项目设置不同的用户名和邮箱,用来区分个人仓库和公司仓库
git 如何为不同的项目设置不同的用户名和邮箱,用来区分个人仓库和公司仓库
77 0
|
1月前
|
开发工具 git
git撤销推送到远端仓库的提交commit信息
git撤销推送到远端仓库的提交commit信息