> <\body> |>>> <\table-of-contents|toc> |.>>>>|> > |.>>>>|> > |.>>>>|> > 本文在macOS 12.2.1中撰写。 <\session|shell|default> <\unfolded-io|Shell] > git --version <|unfolded-io> git version 2.30.1 (Apple Git-130) <\input|Shell] > \; <\session|shell|default> <\input|Shell] > git config --global alias.co checkout <\input|Shell] > git config --global alias.ci commit <\input|Shell] > git config --global alias.br branch <\input|Shell] > git config --global alias.st status <\input|Shell] > \; 默认情况下,无法显示中文(以正在撰写中的本文为例): <\session|shell|default> <\unfolded-io|Shell] > cd ~/planet && git status # 仅用于展示效果,不影响Git配置 <|unfolded-io> On branch da/git_intro Untracked files: \ \ (use "git add \file\..." to include in what will be committed) \ \ \ \ \ \ \ \ [31m"\\346\\262\\210\\346\\265\\252\\347\\206\\212\\347\\214\\253\\345\\204\\277/Git\\345\\205\\245\\351\\227\\250.tm"[m \; nothing added to commit but untracked files present (use "git add" to track) <\input|Shell] > \; 通过配置可以解决这个问题: <\session|shell|default> <\input|Shell] > git config --global core.quotepath false <\unfolded-io|Shell] > cd ~/planet && git status # 仅用于展示效果,不影响Git配置 <|unfolded-io> On branch da/git_intro Untracked files: \ \ (use "git add \file\..." to include in what will be committed) \ \ \ \ \ \ \ \ 沈浪熊猫儿/Git入门.tm \; nothing added to commit but untracked files present (use "git add" to track) <\input|Shell] > \; <\warning*> 请使用你自己的用户名和邮箱 <\session|shell|default> <\input|Shell] > git config --global user.name "沈浪熊猫儿" <\input|Shell] > git config --global user.email "shenda@ustc.edu" <\unfolded-io|Shell] > cat ~/.gitconfig <|unfolded-io> [alias] \ \ \ \ \ \ \ \ co = checkout \ \ \ \ \ \ \ \ ci = commit \ \ \ \ \ \ \ \ br = branch [core] \ \ \ \ \ \ \ \ quotepath = false [user] \ \ \ \ \ \ \ \ name = 沈浪熊猫儿 \ \ \ \ \ \ \ \ email = shenda@ustc.edu <\input|Shell] > \; <\initial> <\collection> <\references> <\collection> > > > <\auxiliary> <\collection> <\associate|toc> |配置常用别名,可以减少手指的磨损 |.>>>>|> > |如何正常显示中文 |.>>>>|> > |配置用户名和邮箱 |.>>>>|> >