🚀 A supercharged Git CLI to streamline your workflow with automated branch naming, syncing, and PR creation.
npm install git-turbogt)A supercharged CLI for Git, designed to streamline your workflow and boost productivity. With gt, you can execute common Git commands faster and more efficiently, making version control a breeze. Whether you're a seasoned developer or just getting started with Git, gt offers a user-friendly interface and powerful features to enhance your coding experience. Say goodbye to complex Git commands and hello to gt – your new best friend in version control!
``bash`
npm install -g git-turbo
`bash`create new feature branch from base branch
gt nb main feature-branch -p f-> creates feature/feature-branch from main (and fetches from origin if available)
You can configure prefix aliases by adding a gt.config.ts file to the repository root.
`ts
// gt.config.ts
import { defineConfig } from "git-turbo/config";
export default defineConfig({
nb: {
prefixes: {
f: "feature/",
b: "fix/",
r: "refactor/",
c: "chore/",
h: "hotfix/",
s: "spike/",
},
},
});
`
`bash`
gt -h-> displays help information
Create a new branch from a base branch with a prefix.
Options:
- -p, --prefix : Prefix to prepend (e.g. feature/). Aliases: f/b/r/c/h/s--remote
- : Remote name to fetch from (default: origin if it exists)-t, --track
- : Set upstream when creating from a remote ref-F, --force
- : Delete existing branch if it exists-y, --yes
- : Skip confirmation
Example:
`bash`
gt nb main my-feature -p f-> creates feature/my-feature from main
`bash`Explicit prefix
gt nb main my-feature -p feature/
`bash`Use a remote base (also works without --remote if you pass origin/main)
gt nb origin/main my-feature -p f --track
Sync current branch with main branch (stash, pull main, rebase, stash pop).
Options:
- -b, --base : Base branch to sync with (default: main)
Cleanup merged local branches.
Options:
- -b, --base : Base branch to check against (default: main)-y, --yes
- : Skip confirmation
Add, commit, push and create a pull request using GitHub CLI (gh).
If you find yourself using certain commands frequently, you can set up aliases in your shell configuration (e.g., .zshrc or .bashrc):
`bashExample: Use 'nb' instead of 'gt nb'
alias nb='gt nb'