Git-预设置

Who are you?

Every Git commit includes the author’s name and e-mail. Make sure Git knows your name and email by running these two commands:

1
2
git config --global user.name "csmtc"
git config --global user.email csmtc@outlook.com

git log

git log is a command for looking at the history of your repository. To create a special version of git log that summarizes the history of your repo, let’s create a git lol alias using the command (all on one line):

1
git config --global alias.lol "log --graph --oneline --decorate --color --all"

Now, in any repository you can use:

1
git lol

to see an ASCII-art graph of the commit history.

代理

代理协议支持 http,https,socks5 等

1
git config --global http.proxy http://127.0.0.1:57890

default branch

1
git config --global init.defaultBranch main

check

To confirm that you set up Git properly, run

1
git config --list

and look for the settings you made in its output:

测试连接

1
2
ssh -T git@github.com
ssh -T git@gitee.com