配置与秘钥
2025年2月13日小于 1 分钟
git配置
提示
git全局配置文件一般在~/.gitconfig
示例:
[url "https://"]
insteadOf = git://
[http]
sslVerify = false
[alias]
st = status
co = checkout
br = branch
sw = switch
cl = clean
ci = commit
last = log -1
[color]
ui = true
[user]
name = 用户名
email = 邮箱
查看全局配置
git config --global -l
全局配置
git config --global user.name "用户名"
git config --global user.email 邮箱
配置秘钥
ssh-keygen -t rsa -C "邮箱"
- 指定路径和名称
提示
该示例是在Linux下指定路径和文件名称
ssh-keygen -t rsa -C "邮箱" -f ~/.ssh/id_rsa_git
配合前端防止报错
这是因为npm包也放在了github上的缘故
git config --global url."https://".insteadOf git://
git config --global http.sslVerify false