Package Exports
- hgit
- hgit/bin/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hgit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hgit
š an unopinionated git workflow cli tool
Streamline and Simplify complex git processes

Sample Config
sample-generated-config-file
sample
{
"config_version": "0.37.1",
"trunk_branch_name": "xorg",
"sleep_between_commands": 3000,
"graph_git_log_limit": 40,
"bug_tracker_path": "https://metaory.atlassian.net/browse/{taskId}",
"commands": {
"ls-list": "ls -l",
"ls-count": "ls -l | wc -l",
"git_push_origin": "git push --set-upstream origin {branchName}",
"git_checkout_branch": "git checkout {branchName}",
"git_create_branch": "git checkout -b {branchName}",
"git_fetch_origin": "git fetch origin",
"git_checkout_dev": "git checkout dev",
"git_merge_dev": "git merge origin/dev",
"git_checkout_master": "git checkout master",
"git_merge_master": "git merge origin/master",
"git_is_inside_worktree": "git rev-parse --is-inside-work-tree",
"git_prune": "git gc --prune=now && git remote prune origin",
"git_reset_master": "git reset --hard master",
"git_reset_head": "git reset --hard HEAD~1",
"git_merge_abort": "git merge --abort || true",
"git_is_dirty": "git status --short",
"git_status": "git status",
"git_workflow_add": "git worktree add -b {branchName} {path} {origin}",
"git_workflow_list": "git worktree list"
},
"checkout": [
"git_fetch_origin",
"git_checkout_branch",
"git_status"
],
"start_workflow": {
"xorg__branch_pattern": "xorg/{description}",
"xorg": [
"git_fetch_origin",
"git_checkout_master",
"git_merge_master",
"git_create_branch",
"git_status"
],
"feature__branch_pattern": "{branchType}/{taskId}-{description}",
"feature": [
"git_fetch_origin",
"git_checkout_master",
"git_merge_master",
"prompt_checkout__xorg",
"git_create_branch",
"git_status"
],
"foo__branch_pattern": "{branchType}/{taskId}-{description}",
"foo": [
"git_fetch_origin",
"git_checkout_master",
"git_merge_master",
"prompt_checkout__xorg",
"git_create_branch",
"git_status"
],
"bar__branch_pattern": "{branchType}/{taskId}-{description}",
"bar": [
"git_fetch_origin",
"git_checkout_master",
"git_merge_master",
"git_create_branch",
"git_status"
]
}
}
Features
- check for
conflictbetween multiple remote branch - start new workflows from a
configfile - ALL commands are read from the config file in
~/.config/hgit/config.json dynamic branch checkoutin workflows with command:prompt_checkout__{pattern}branchNamePatternfrom config:{branchType}__branch_pattern
npx
npx hgitInstallation
npm i -g hgitUsage
hgitOptions
--verbose | verbose logsTL;DR
The Default configs
| branch | create from | can sync from | branch name |
|---|---|---|---|
| flight | master | master | flight/{description} |
| hotfix | master | master | hotfix/{taskId}-{description} |
| feature | flight | parent flight | feature/{taskId}-{description} |
| bugfix | flight | parent flight | bugfix/{taskId}-{description} |
| other | flight | parent flight | other/{taskId}-{description} |
Hotfix branch:
- Can only be created fromĀ
master - While branch in active, can sync fromĀ
master - Cannot take pull fromĀ
dev - Should not take pull from anotherĀ
feature / flight / hotfixĀ branch
Flight branch:
- Will only be created fromĀ
master - Can sync fromĀ
master - Cannot sync fromĀ
dev
feature/bugfix/other in Flight (Child branch -> Flight branch):
- Task branches (feature/bugfix/other) should be created from theĀ
FlightĀ branch - Cannot take pull from any branch butĀ
FlightĀ branch - Can take pull from a sibling branch of theĀ same flightĀ if it depends on it
Flights(trunk)
- flight is for the features, bugs, and improvements corresponding to the flight (epic) in the
BugTracking system - Ticket branches can be created from a flight branch.
- There are 3 ticket branch prefixes:Ā feature,Ā bugfix, andĀ other. These branches require a
BugTracking task IDin their names.
featureis for the small packed features inside the flight.bugfixis for the fixes and issues related to the flight.otheris used for non-technical issues like documentation or infrastructure improvements, etc.
Hotfix
- hotfix is dedicated to fixes regarding critical issues in the production environment.