git其他知识介绍
常用忽略文件
https://github.com/seeways/MyIgnore
配置别名
|
|
建议熟悉git命令后使用
|
|
对长命令的别名尤其好用 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
显示颜色
如果没有默认显示变更文件的颜色,推荐此选项
|
|
git config
- 配置Git的时候,加上–global是针对当前用户起作用的,如果不加,那只针对当前的仓库起作用。
- 仓库的Git配置文件都在仓库.git/config文件中
- 全局的Git配置文件放在用户主目录下的.gitconfig中(隐藏文件)
- 如果想修改配置或者别名,直接修改或删掉即可
- Author: 知乎
- Link: https://www.zhihu.hk/other-about-git.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.