【问题标题】:how can i make git log show tree with all my parameters by default?默认情况下,如何使用我的所有参数使 git log 显示树?
【发布时间】:2017-09-28 20:19:13
【问题描述】:

我经常使用“git log --graph --all --decorate --online”命令。

用所有参数编写它既冗长又乏味。 我知道我希望这些选项始终应用于我的 git log cmd。

编辑:我只想让 git 改变它的行为——而不是在它之外写一些脚本,调整 win shell 或 smth! 我想写 "git log",它确实是

"git log --graph --all --decorate --online"自动

和 vim 一样,可能有一些默认配置文件?

【问题讨论】:

标签: git github


【解决方案1】:

您可以在~/.gitconfig 文件中创建别名。

基本上,将以下内容添加到您的.gitconfig

[alias]
     llog = log --graph --all --decorate --online

现在当你调用git llog时,它会执行git log --graph --all --decorate --online

更多信息请阅读this

【讨论】:

  • 所以“git log”永远只绑定一个默认行为?我不能改变吗?但我可以创建别名?
  • 我不确定。但即使有可能,我认为使用别名更安全
  • 很好用,我的工作效率现在可能会提高 10% ..))))
  • git config --global alias.llog "log --all --graph --decorate --oneline" 是你需要在命令行中打卡的cmd
猜你喜欢
  • 2012-11-30
  • 2019-08-14
  • 2017-09-19
  • 2012-11-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-20
相关资源
最近更新 更多