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即可。

相关推荐
zzzyyy5383 小时前
Linux之缓冲区
linux·运维·服务器
hwscom3 小时前
Linux服务器如何进行安全加固,防止黑客攻击(Windows也适用)
linux·服务器·安全
程序员夏末3 小时前
【开源经历 | 第一篇】参与开源需要掌握的Git和Github指令
git·开源
lzh200409193 小时前
Linux管道(Pipe)深度指南:从原理到实战
linux·c++
liann1193 小时前
3.4_Linux 应急响应排查速查命令表
linux·运维·服务器·安全·网络安全·系统安全
孪生质数-3 小时前
Linux高危漏洞通报Copy Fail - CVE-2026-31431
linux·运维·服务器·ubuntu·网络安全·debian·cve-2026-31431
IMPYLH3 小时前
Linux 的 tee 命令
linux·运维·服务器·bash
lzh200409193 小时前
Linux信号(Signal)
linux·c++
pc07933 小时前
带网络接口的打印机和USB接口打印机的共享区别
运维·服务器·网络
理人综艺好会4 小时前
nginx了解
运维·nginx