扩展Git功能 [英] Extending Git functionality

查看:102
本文介绍了扩展Git功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种简单的方法来扩展Git命令。

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.

比方说,像插件 in Vim?

Let's say, something like the support of plugins in Vim?

推荐答案

正如你可以看到 execv_dashed_external 中源代码中的,如果您使命令 git-my-custom-

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-扩展名 man git-my-custom-made-extension

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

没有什么特别的扩展git。按照正常方式构建程序,并确保名称以 git - 开头。

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

这篇关于扩展Git功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆