Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending Git functionality

Tags:

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?

like image 507
Vincent B. Avatar asked Jun 11 '12 10:06

Vincent B.


People also ask

What is git extension used for?

GIT Extensions is a distributed version control system enabling a user to robustly manage a collection of source files and the changes made in them. The changes made are shown in the History of changes. Users can make changes by accessing a Central repository called remote repository and committing the changes to it.


1 Answers

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-.

like image 81
Eric Avatar answered Sep 18 '22 19:09

Eric