本文主要是介绍linux git凭证管理,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
linux git 凭证管理
解决命令行git登录github的问题,支持两步验证
同样适用于Azure Devops, Bitbucket
官网:
https://github.com/git-ecosystem/git-credential-manager
https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md
安装
从https://github.com/GitCredentialManager/git-credential-manager/releases/latest下载对应的包
# debian系列为例
sudo dpkg -i gcm-manager-xxx.deb
配置
不要使用git-credential-manager configure
来配置,默认显示UI
中文可能有字体问题,命令行环境下非常不友好。
# 全不全局看需求
git config --global credential.helper "/usr/local/bin/git-credential-manager --no-ui"
git config --global credential.credentialStore secretservice# 配置某个项目的凭证用户名
cd yourproject
git config credential.username yourname
注意
1、运行代码前确保知晓代码含义,以及去除CSDN添加的尾巴。
2、本文仅做技术交流,因任何原因导致的任何问题,本文概不负责。
3、使用UI去除 --no-ui
即可。
这篇关于linux git凭证管理的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!