Git

Git Cheat Sheet #

Git 凭证配置 #

使用 git config credential.helper 来控制 Git 凭证

保存凭证 #

# 将凭证用明文的形式存放在磁盘中
git config --global credential.helper store  
# 配置到缓存 默认15分钟  
git config --global credential.helper cache   
# 修改缓存时间  
git config --global credential.helper 'cache --timeout=3600'    

store 会将凭证明文存放在 $HOME/. git-credentials

删除凭证 #

# 如果重新启用的话, 还将继续拥有其存储库中可用的缓存的凭据
git config --global --unset credential.helper