git帐号密码过时了,在gitlab上修改后,本地还没进行同步时,链接远端仓库,报了这个错git
git config --system --unset credential.helper
git config --global user.email "you@example.com" git config --global user.name "Your Name"
git config --global credential.helper store
不想用命令行,也能够直接手动修改配置文件。缓存
git 有多个范围(scope)的的配置文件,范围小的,覆盖范围大的
通常有system、global、local、worktree
存放目录以下:gitlab
scope | location | filename |
---|---|---|
system | <git-install-root>\etc\,如:C:\Program Files\Git\etc\ | gitconfig |
global | C:\Users\<username>\ | .gitconfig |
local | <git-repo>.git\ | config |
worktree | 同上 | config.worktree |
记不住配置了哪些scope,能够使用如下命令查看全部的git配置文件spa
git config --list --show-origin
详细地列出配置内容和配置文件路径命令行
与下面命令不一样的是,下面命令只显示配置信息,不显示路径code
git config --list
git 若是是经过http访问远程仓库,须要输入用户名和密码,此时,若是不将凭证存储,则须要一遍一遍地输入用户名密码。blog
git config credential.helper "$helper $options"
模式 | 存储时长 | 存储位置 |
---|---|---|
不缓存【默认】 | -- | -- |
cache | 15min | 内存 |
store | 永久 | 磁盘 |
[其余] | -- | -- |