目录
1、安装 git
全程默认安装:
2、配置
作为代码提交、下拉、注释时的记录。配置信息存在于文件中 .gitconfig 中。
2.1 查看环境配置
2.2 配置用户和邮箱
$ git config --global user.name "gitxxx"
$ git config --global user.email "xxx@qq.com"
2.3 生成公钥
$ ssh-keygen -t rsa -C "email"
2.4 记住密码
git config --global credential.helper store
3、配置文件 .gitconfig
[user]
name = belien
email = xxxx@qq.com
[credential]
helper = store
[core]
whitespace = disable
# 显示 status 编码
quotepath=false
[gui]
# 图形界面编码
encoding = utf-8
# 命令别名自定义
[alias]
BelienConfigEncoding = config --global core.quotepath false && git config --global gui.encoding utf-8 && git config --global i18n.commit.encoding utf-8 && git config --global i18n.logoutputencoding utf-8 && export LESSCHARSET=utf-8
BelienConfig1 = config --global i18n.commitencoding utf-8
BelienConfig2 = config --global i18n.logoutputencoding utf-8
# 清除 .gitignore 配置的文件及文件夹
BelienClean = clean -Xdf
# 导出文件,需要进行重定向: > test.csv
BelienExport = log --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'"%an","%ae","%ad","%s"'
[i18n]
commitencoding = utf-8
logoutputencoding = utf-8
4、配色方案
修改系统盘下的 .minttyrc 文件:C:\Users\LENOVO\.minttyrc
Locale=zh_CN
Charset=UTF-8
Columns=84
Rows=24
Font=JetBrains Mono Bold
FontHeight=11
Term=xterm-256color
CursorType=block
CursorBlinks=yes
Transparency=low
BoldAsFont=yes
AllowBlinking=no
Scrollbar=none
ScrollbackLines=10000
ClickTargetMod=off
ComposeKey=shift
ForegroundColour=248,248,242
BackgroundColour=39,40,34
CursorColour=255,255,255
Black=39,40,34
BoldBlack=117,113,94
Red=249,38,114
BoldRed=204,6,78
Green=166,226,46
BoldGreen=122,172,24
Yellow=255,255,81
Blue=144,255,255
Magenta=174,129,255
Cyan=161,239,228
BoldColour=255,255,255
White=248,248,242
BlinkColour=255,255,255
CtrlShiftShortcuts=yes
字体设置需另外安装:Jetbrains Mono
5、便捷工具
5.1 Fork
-
优点:开源、启动速度快、仓库构建和 remote 方式便捷;
-
缺点:只支持英文,无法显示中文;
-
下载:Fork - a fast and friendly git client for Mac and Windows
5.2 vscode + Gitlens
-
优点:开源、支持多种编码、更丰富的单节点操作技巧、提交硬回退;
-
缺点:启动速度慢;