]> git.phdru.name Git - git-wiki.git/blobdiff - git-wiki.txt
Explain recursive aliases
[git-wiki.git] / git-wiki.txt
index 57ba2841df3073409166f467b39f2fb573662915..c1a831a94c77c0e585be299e52e07c0bb879e8db 100644 (file)
@@ -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
 ----