🗜 gitz - tiny useful git commands, some dangerous 🗜
Project description
🗜 gitz - git commands for rapid development 🗜
This is a collection of seventeen git utilities, the majority of which are aimed at people doing rapid development using Git.
Gitz is for two types of users - quality-obsessed individuals who relentlessly manicure their pull requests until every byte is in the right place; and ultra-rapid developers who want to generate large features quickly while taking advantage of continuous integration.
Most of them only exist here, one comes from other git repos, one came from a chat on Reddit and I don’t know where one of them came from
Four of them are written in Bash, the rest use Python 3.
How to install
Using pip:
pip3 install gitz
Otherwise, download and uncompress this directory, then put that downloaded directory’s path into the PATH environment variable.
Getting help
Below there’s a summary of each command, and a link to a manual page. Or from the terminal, use -h flag like this: git new -h.
When to use gitz
At the start of a session
git new safely creates fresh branches from upstream
git update for each branch, rebases from upstream and pushes
During development
git st is a more compact and prettier git status
git ls shows you when documents were last changed
During rapid development
git amp amends and force-pushes the message of the last commit - great for minor spelling mistakes
git infer commits files with an automatically generated message - great for committing tiny changes for later rebasing down
While cleaning commits for release
git combine combines multiple commits and optionally squashes them
git shuffle shuffles and removes commits in the current branch
git snip removes commits in the current branch
git split split one or more commits, perhaps with the staging area, into many small individual commits, one per file
During branch maintenance
git rotate rotates through all branches
git copy, git delete, and git rename work both remotely and locally
Working with continuous integration
git stripe pushes branches with a sequence of commits to a remote where CI can find and test them
The gitz commands
Safe commands
Informational commands that don’t change your repository
- git-gitz
Print information about the gitz environment
- git-infer
Commit changes with an auto-generated message (from https://github.com/moondewio/git-infer)
- git-ls
List each file with its most recent commit, in subtle color (from an unknown source)
- git-new
Create and push new branches
- git-rotate
Rotate the current branch forward or backward in the list of branches
- git-st
Colorful, compact git status
This version written by https://github.com/PlatyPew/, original version by https://www.reddit.com/user/ex1c)
- git-stripe
Push a sequence of commit IDs to a remote repository
Dangerous commands that delete, rename or overwrite branches
- git-copy
Copy a git branch locally and on all remotes
- git-delete
Delete one or more branches locally and on all remotes
- git-rename
Rename a git branch locally and on all remotes
By default, the branches develop and master and the remote upstream are protected - they are not allowed to be copied to, renamed, or deleted.
You can configure this in three ways:
setting the --all/-a flag ignore protected branches entirely
setting one of the the environment variables GITZ_PROTECTED_BRANCHES or GITZ_PROTECTED_REMOTES overrides these defaults
setting a value for the keys PROTECTED_BRANCHES or PROTECTED_REMOTES in the file .gitz.json in the top directory of your Git project
Dangerous commands that rewrite history
Slice, dice, shuffle and split your commits.
These commands are not intended for use on a shared or production branch, but can significantly speed up rapid development on private branches.
- git-amp
AMend just the last commit message and force-Push, somewhat safely
- git-combine
Combine multiple commits into one
- git-shuffle
Reorder and delete commits in the existing branch
- git-snip
Edit one or more commits out of history
- git-split
Split a range of commits into many single-file commits
- git-update
Update branches from the reference branch
Dangerous commands that are janky
git-all is something I use all the time, but it only works in simple cases, and I don’t see a good path to making it do complicated things in a sane way.
- git-all
Perform a command on each of multiple branches or directories
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.