From 08ff71dcde3af9361d87583c8de78f72737b0bee Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 28 Apr 2017 16:07:51 +0300 Subject: [PATCH] Explain recursive aliases --- git-wiki.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/git-wiki.txt b/git-wiki.txt index 57ba284..c1a831a 100644 --- a/git-wiki.txt +++ b/git-wiki.txt @@ -756,6 +756,29 @@ See `WhatIsTheIndex Wiki. +Aliases +------- + +Recursive aliases +''''''''''''''''' + +Git doesn't allow recursive aliases. The expansion of an alias is +interpreted by git as a builtin command. I.e., in the following example +alias ``com`` doesn't work because there is no builtin command ``git +ci``:: + + [alias] + ci = commit + com = ci + +You can trick git by using shell. The following example works albeit a +bit slow:: + + [alias] + ci = commit + com = !git ci + + Root ---- -- 2.39.5