Git(一): 安装和基本配置

目录

1、安装 git

2、配置

2.1 查看环境配置

2.2 配置用户和邮箱

2.3 生成公钥

2.4 记住密码


1、安装 git

官网:https://git-scm.com/

全程默认安装:

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

5.2 vscode + Gitlens

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值