I was wondering if there was an easy way to extend Git commands.
So I could create commands like:
git my-custom-made-extension --my-options <my-other-arguments>
In a perfect world, I would be able to do it in any language it pleases me and I would be able to add my custom made extensions to any development environment fairly easily.
Let’s say, something like the support of plugins in Vim?
As you can see in the source code in
execv_dashed_external, If you make the commandgit-my-custom-made-extension, then git will alias:git my-custom-made-extension ...→git-my-custom-made-extension ...git help my-custom-made-extension→man git-my-custom-made-extensionThere’s nothing special about “extending git”. Just build a program as you would normally, and make sure the name starts with
git-.