【Git技巧】第十篇 解决每次git clone都需要输入账号密码

当使用gitclone时,可以配置全局认证信息以避免每次都输入账号密码。通过运行`gitconfig--globalcredential.helperstore`,可以永久保存GitHub或GitLab的访问令牌。此外,还可以手动设置其他Git配置,如颜色、HTTP缓冲区大小、SSL验证、用户名和邮箱以及默认分支。
摘要由CSDN通过智能技术生成

目录

1、遇到问题

2、问题解决

3、可以手动设置


1、遇到问题


每次 git clone 时都需要输入账号、密码。

2、问题解决


配置全局开机认证信息保存:

git config --global credential.helper store


可以永久保存。除非用命令解除。

然后在输入账号密码之后,后面每次克隆不需要输入。

谨记:密码是gitHub或gitlab上的访问令牌。

3、可以手动设置

git config --global credential.helper "store"
git config --global color.ui "auto"
git config --global http.postBuffer 524288000
git config --global https.postBuffer 524288000
git config --global https.sslVerify "true"
git config --global user.name "开启了权限的账号"
git config --global user.email "开启了权限的账号对应的邮箱"
git config --global init.defaultBranch "master"

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
引用:一般拉取线上代码的先 1.git clone 2.在输入用户名 3.输入密码 等三步操作,这样子太麻烦了 直接一步操作 git clone http://用户名:密码@地址。 引用:例子 如果你用户叫123xxx 密码是mypassword 地址是git.xxx.com/www.git git clone http://123xxx:mypassword@git.xxx.com/www.git。 当你使用git clone命令时,你可以通过在地址后面直接加上用户名和密码来简化操作。例如,如果你的用户名是123xxx,密码是mypassword,地址是git.xxx.com/www.git,那么你可以使用以下命令来进行一步操作:git clone http://123xxx:mypassword@git.xxx.com/www.git。这样就可以直接拉取线上代码,无需再输入用户名和密码。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [git clone的时候直接加上用户名和密码](https://blog.csdn.net/weixin_42821697/article/details/121147454)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [git ------ git clone方法总结(可直接加账户和密码)](https://blog.csdn.net/COCOLI_BK/article/details/98876944)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值