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下载对应的包

shell 复制代码
# debian系列为例
sudo dpkg -i gcm-manager-xxx.deb

配置

不要使用git-credential-manager configure来配置,默认显示UI

中文可能有字体问题,命令行环境下非常不友好。

shell 复制代码
# 全不全局看需求
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即可。

相关推荐
努力进修21 分钟前
Docker+cpolar 实战:打造灵活可控的远程办公系统
运维·docker·容器
其实防守也摸鱼26 分钟前
运维--怎么看接口的请求和返回
运维·学习·网络安全·网络攻击模型·burpsuite·攻防对抗·蓝队
weixin_307779132 小时前
Linux下Nginx故障系统化检查Shell脚本
linux·运维·服务器·nginx·自动化
梦想三三2 小时前
Git与GitHub基础入门:从零开始掌握版本控制与代码托管(完整图文教程)
人工智能·git·elasticsearch·github
skyutuzz2 小时前
node安装部署
linux
一次旅行3 小时前
【AI工具】Rust-Based CLI:用 xargs 和并行加速你的 Linux 日常
linux·开发语言·rust
jieyucx3 小时前
Docker 入门第一阶段:建立正确认知与初体验
运维·docker·容器
qetfw5 小时前
CentOS 7 基础环境配置
linux·运维·centos
天空'之城5 小时前
Linux 系统编程 21:守护进程与日志系统全解
linux·系统编程·日志系统·守护进程
jieyucx6 小时前
Docker 入门第二阶段:掌握日常命令
运维·docker·容器