[Git] 026 config 命令的补充

少废话,上例子

1. 让命令更醒目

$ git config --global color.ui true

2. 偷懒

$ git config --global alias.st status

  • 使用 "st" 表示 "status"
  • 这一步和 "remote" 相似
    • 使用 "origin" 代替地址
  • 好久没碰单片机了,依稀记得开头常写

    • #define uint unsigned int
    • sbit key1 = P3^1
    • 相似的偷懒思想

3. 常用的缩写1

  • $ git config --global alias.co checkout
  • $ git config --global alias.ci commit
  • $ git config --global alias.br branch
  • $ git config --global alias.unstage 'reset HEAD'
    • 上面一句相当于下方两句之和
    • $ git unstage test.py
    • $ git reset HEAD test.py
  • $ git config --global alias.last 'log -1'
    • 显示最近一次的提交
    • 下回只需这样 git last
  • $ 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"
    • 我看到了 Python 的影子

  1. 摘取自廖雪峰老师的《Git 教程》

猜你喜欢

转载自www.cnblogs.com/yorkyu/p/10853718.html