Skip to content

配置

用户

.git/config
...
[user]
    name = gozeon
    email = goze.qiu@gmail.com
...

or

## --global 全局参数
## 设置
git config user.name gozeon
git config user.email goze.qiu@gmail.com

## 取消
git config --global --unsetuser.name

文件权限

多个系统同时操作一个文件

.git/config
[core]
    filemode = false

代理

.git/config
...
[http]
    proxy = socks5://127.0.0.1:2023
...

or

## --global 全局参数
## 设置
git config http.proxy socks5://127.0.0.1:2023

## 取消
git config --global --unset http.proxy

or

~/.ssh/config
Host github.com
        User Gozeon
    Hostname github.com
    ProxyCommand nc -x 127.0.0.1:2024 %h %p
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_rsa_github

Host gitlab.com
        User goze
        Hostname gitlab.com
    ProxyCommand nc -x 127.0.0.1:2024 %h %p
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_rsa_gitlab