首页 > 解决方案 > Git 别名文档

问题描述

我已经知道如何制作别名,简单的,复杂的,一切都很好,除了......

我现在想记录我的别名,所以当我这样做时

git my-super-alias --help

而不是仅仅得到:

'my-super-alias' is aliased to '[super specific set of instructions]'

我会得到:

'my-super-alias' is aliased to '[super specific set of instructions]' this serves [super specific purpose] which is useful for [super specific, yet not very obvious at first glance, reason]

有什么办法可以在本机 git config 中使用它?

标签: gitconfigurationdocumentationalias

解决方案


您可以使超级特定指令集的开始成为对他们的帮助。

$ git config alias.testhelp '!# My super specific command does AMAZING THINGS!
date'
$ git testhelp
Fri Jan 29 11:29:52 AM PST 2021
$ git help testhelp
'testhelp ' is aliased to '!# My super specific command does AMAZING THINGS!
date'
$

推荐阅读