GitExt: Git extra commands
Intro
This application helps to extend base GIT API.
It extends:
- git flow
- git tag, (*1)
Installation
Installation by using global scope
Get package via composer:, (*2)
$ composer global require rikby/gitext ^0.10
And install commands into your local git:, (*3)
$ gitext install
or, (*4)
$ bash ~/.composer/vendor/bin/gitext install
Installation through create-project
$ composer create-project rikby/gitext ./gitext ^0.10
And install commands into your local git:, (*5)
$ php ./gitext/bin/gitext install
Inside
Please take a look command files which use for installation in list., (*6)
Commands Using
$ git tags
Sorting Git tags using PHP function version_compare()., (*7)
SemVer must be installed., (*8)
(You may try to use this gist to make quick install node+npm in GitBash.), (*9)
For example we need to add new build/pre-release, (*10)
# show tag sorted by semver
$ semver $(git tag)
v1.0.1
[...]
v1.2.0-alpha.5
$ git tag-semver --increment prerelease
New tag: v1.2.0-alpha.1
$ semver $(git tag)
v1.0.1
[...]
v1.2.0-alpha.5
v1.2.0-alpha.6
Sorting Git tags according to semantic versioning., (*11)
Actually it uses PHP function version_compare() but seem it works in the same way., (*12)
There is no tag name validation., (*13)
GitFlow settings for super feature branch
It can be used for using your "super" issue key in GitFlow.
When you can start feature for a sub-task completely using git-flow., (*14)
In this case "develop" is a "super" issue branch instead of "right" develop., (*15)
So, there are two modes:
- DEFAULT, (*16)
feature prefix = feature/
develop branch = develop
feature prefix = feature/super-
develop branch = feature/super
GitFlow settings for multi composer repository
git flow-namespace
Only for multi composer repository repository., (*17)
Define GitFlow settings based upon branch namespace., (*18)
A namespace will be set automatically by branch name., (*19)
You may add post-checkout Git hook., (*20)
printf "#!""/usr/bin/env bash\n git flow-namespace $@" > $(git rev-parse --show-toplevel)/.git/hooks/post-checkout
.git/hooks/post-checkout file content:, (*21)
#!/usr/bin/env bash
git flow-namespace $@
Environment variables
-
GITEXT_SEMVER_BIN - variable for custom path to semver binary file.
-
GITEXT_GIT_BIN - variable for custom path to git binary file.
-
GITEXT_PHP_BIN - variable for custom path to php binary file.
User GIT commands
You may create your own commands.
Here is an example., (*22)
Create file ~/.gitext/git-hello-there.sh:, (*23)
#!/usr/bin/env bash
# CMD: git hello-there
# DESCR: Some test command.
# you may include some file GitExt files
# . $(gitext source)/shell/lib/git.sh
echo Hello there
Check it in commands list:, (*24)
$ gitext install --help
[...]
git hello-there Some test command.
Install and test:, (*25)
$ gitext install
$ git hello-there
Hello there