主题
Git 配置与常用别名
Git 的配置主要通过命令行完成,常用的配置包括用户名和邮箱,以及定义别名提高操作效率。
基本配置
设置用户名和邮箱:
bash
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
常用别名示例
为常用命令创建简短别名:
bash
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.cm commit
通过别名,可以快速执行常用操作,提升开发效率。