Git 其他
其他操作
常用忽略文件
https://github.com/seeways/MyIgnore
配置别名
1 | git config --global alias.<name> <git-name> |
建议熟悉 git 命令后使用
1 | # 设置别名 |
对长命令的别名尤其好用
git config –global alias.lg “log –color –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit”
使用效果 git lg
显示颜色
如果没有默认显示变更文件的颜色,推荐此选项
1 | git config --global color.ui true |
Git Config
- 配置 Git 的时候,加上 –global 是针对当前用户起作用的,如果不加,那只针对当前的仓库起作用。
- 仓库的 Git 配置文件都在仓库.git/config 文件中
- 全局的 Git 配置文件放在用户主目录下的.gitconfig 中 (隐藏文件)
- 如果想修改配置或者别名,直接修改或删掉即可
本博客所有文章除特别声明外,均采用 CC-BY-SA-3.0 许可协议。转载请注明来源 张小剩的博客!
