Extending Git functionality

后端 未结 3 1659
梦谈多话
梦谈多话 2020-12-03 01:01

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 

        
3条回答
  •  无人及你
    2020-12-03 02:02

    As you can see in the source code in execv_dashed_external, If you make the command git-my-custom-made-extension, then git will alias:

    • git my-custom-made-extension ...git-my-custom-made-extension ...
    • git help my-custom-made-extensionman git-my-custom-made-extension

    There's nothing special about "extending git". Just build a program as you would normally, and make sure the name starts with git-.

提交回复
热议问题