• Stars
    star
    918
  • Rank 49,757 (Top 1.0 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of git utilities and useful extra git scripts.

git-extra-commands

License Build Status Awesomebot Megalinter Code Climate Issue Count GitHub stars

Table of Contents

git-extra-commands is a ZSH plugin that packages some extra git helper scripts I've found. This collection (and the scripts that I wrote in it) is licensed with the Apache Version 2 license.

This collection doesn't actually require ZSH, but packaging it as a ZSH plugin makes it more convenient for people using a ZSH framework to use this collection.

However, some of the scripts in this collection came from other sources and may have different licensing - if they do, their license information is included inline in the script source.

If you wrote one of these scripts and want it removed from this collection, please either make a PR and/or file an issue against the repository and I will remove it.

Included Scripts

Script Original Source Description
git-add-match Git: programmatic staging Allows you to use expect to automatically stage hunks matching a search term
git-add-username-remote Ryan Tomayko's dotfiles Adds a remote for the current repository for the given GitHub username.
git-age Kristoffer Gronlund's wiki A git-blame viewer, written using PyGTK.
git-amend-all John Wiegley's git scripts Adds all modified and deleted files, except the new files and adds them to the recent commit by amending it.
git-attic Leah Neukirchen's blog Displays a list of deleted files in your repository. The output is designed to be copy and pasted: Pass the second field to git show to display the file contents, or just select the hash without ^ to see the commit where removal happened.
git-authors Michael Markert's dotfiles (as git-changes) List authors in the repository in descending commit-count order.
git-big-file Mislav Marohnić's dotfiles Show files in the repository larger than a threshold size.
git-branch-clean @Hefeweizen "branch clean" - rm various copies of a branch (e.g. foo-wip; origin/foo).
git-branch-date Joe Block [email protected] List branches in commit-date order.
git-branch-diff Joe Block [email protected] Diffs your current HEAD with the default branch of the origin remote.
git-branch-name Joe Block [email protected] Prints the current branch name in automation-friendly format.
git-branch-rebaser Vengada Rangaraju [email protected] Kicks off an interactive rebase of all the commits on your branch. Including pushed commits, so be careful.
git-branch-status John Wiegley's git scripts Colorized status report on all branches in your repository.
git-branches-that-touch Mislav Marohnić's dotfiles Shows which branches touch files under a path that are remote, unmerged, have a commit in the last six months and whose name doesn't start with 'enterprise-'.
git-capture-wip @Hefeweizen Capture in-progress file changes.
git-change-author Michael Demmer in jut-io/git-scripts Change one author/email in the history to another.
git-change-log John Wiegley's git-scripts Transform git log output into a complete Changelog for projects that haven't been maintaining one.
git-changes Michael Markert's dotfiles Symlink to git-authors. List authors in the repository in descending commit-count order.
git-checkout-branches John Wiegley's git scripts Checks out all remote branches.
git-checkout-by-date Stack Overflow Lets you checkout several files at once at the version specified by a date.
git-checkout-commit From the fzf wiki Uses fzf to checkout a commit, showing the commit diff as preview.
git-checkout-default-branch I got tired of keeping track of which repositories use main, master or something else as default branch Checks out the default branch of the origin remote so you don't have to remember which repositories use master, main or whatever.
git-checkout-pr Based on gist.github.com/gnarf/5406589 Check out a PR locally.
git-checkout-preview From the fzf wiki Uses fzf to checkout a branch, showing what commits diverge between the branches.
git-checkout-tag Joe Block [email protected] Check out a tag into a branch named after the tag.
git-children-of John Wiegley's git-scripts Shows the children of a given git commit.
git-churn Gary Bernhardt's dotfiles Show which files are getting changed most often in the repository.
git-clone-subset Rodrigo Silva (MestreLion) [email protected] Uses git clone and git filter-branch to remove from the clone all files but the ones requested, along with their associated commit history.
git-comma Leah Neukirchen's blog Adds and commits a file in one command.
git-commit-browser From the fzf wiki Uses fzf to browse commit history.
git-conflicts Seth Messer's bits and bobs repository Show files with conflicts.
git-copy-branch-name Zach Holman's dotfiles Copy the current branch's name to the clipboard (macOS Only).
git-credit git-credit-author Zach Holman's dotfiles
git-current-branch Joe Block [email protected] Prints the name of the current branch with no odd characters or formatting, mainly useful in automation scripts.
git-current-commit Joe Block [email protected] Prints the hash of the current commit with no odd characters or formatting, mainly useful in automation scripts.
git-cut-branch Ryan Tomayko's dotfiles Create a new branch pointed at HEAD and reset the current branch to the head of its tracking branch.
git-delete-dangling-commits Stack Overflow Clean up dangling commits that are not on any branch.
git-delete-local-merged From a deleted post by @tekkub Delete all local branches that have been merged into HEAD.
git-delete-merged-branches ? Purges all branches that have been merged to a target branch (defaults to branches merged to master).
git-delete-remote-branch Joe Block [email protected] Delete a branch from a specified remote.
git-delete-squashed-and-merged-branches Paul Irish's dotfiles Purges all branches that have been squashed and merged to a target branch (defaults to branches merged to master). Requires pygithub.
git-delete-tag Joe Block [email protected] Delete a tag, both locally and from the origin remote.
git-diff-last Sebastian Schuberth Show the last change made to a file in the repository.
git-divergence Gary Bernhardt's dotfiles Shows differences between local branch and its tracking branch.
git-edit-conflicts Joe Block [email protected] Edit the files that are marked as conflicted during a merge/rebase in your $EDITOR/$VISUAL.
git-fetch-prs Pretty sure I saw this on slack, but can't recall which one Get all Pull Request branches from a given remote by refspec.
git-files Jake Zimmerman's blog List the files different between the current branch and $REVIEW_BRANCH, which if unset defaults to the repository's default branch.
git-find-dirty Matthew McCullough's scripts repository.
git-flush John Wiegley's git-scripts Compact your repository by dropping all reflogs, stashes, and other cruft that may be bloating your pack files.
git-force-mtimes John Wiegley's git-scripts Sets modification times of all files in the repository their last change date based on git's log. Useful to avoid too new dates after a checkout confusing make or rake.
git-forest Jan Engelhardt Prints a text-based tree visualisation of your repository. Requires Git.pm.
git-functionlog Joe Block [email protected] Allows you to get a git log of a particular function, not a file.
git-fzf-add Fuzzy Finding in Bash with fzf Use fzf to select files to add to git.
git-fzf-log-browser Fuzzy Finding in Bash with fzf Use fzf to browse the repository's git log.
git-fzf-pickaxe-browser Fuzzy Finding in Bash with fzf Use fzf to display a git log list that has been filtered with pickaxe for a search term.
git-fzf-reflog-browser Fuzzy Finding in Bash with fzf Use fzf to browse the repository's git reflog list that can be filtered by entering a fuzzy term at the prompt. Navigation up and down the hash list will preview the changes of each hash.
git-git Joe Block [email protected] Typing git git foo will make git do a git foo instead of complaining.
git-github-open ? Open GitHub file/blob page for FILE on LINE.
git-gitlab-mr Noel Cower's gist Open a merge request on GitLab.
git-history-graph Stack Overflow Pretty git log, single line per commit, with branch graphing.
git-ignored ? Show files being ignored by git in the repository.
git-improved-merge Mislav Marohnić's dotfiles Sophisticated git merge with integrated CI check and automatic cleanup.
git-incoming Michael Markert's dotfiles Show commits in the tracking branch that are not in the local branch.
git-jump Cowboy's dotfiles Replays git commits by moving forward / backward through a branch's history.
git-latest-tag Joe Block [email protected] Fetch tags from all remotes and show the most recent tag name.
git-lines Neil Killeen [email protected] Gives you a list of author names with the number of lines last updated by that user in files in the current directory tree with the extension specified.
git-log-single-file Joe Block [email protected] Show the log for a single file.
git-ls-branch-files Joe Block List files changed between a specified branch and the current branch.
git-ls-object-refs Ryan Tomayko's dotfiles Find references to an object with SHA1 in refs, commits, and trees. All of them.
git-maildiff Sanjeev Kumar's blogpost A simple git command to email diff in color to reviewer/ co-worker.
git-make-gitignore #commandline-fu on coffeeops Prints a language-specific .gitignore file using gitignore.io.
git-maxpack John Wiegley's git-scripts Compress a repository's pack files as much as possible.
git-merged-branches Sergei Boiko's Git housekeeping tutorial: clean-up outdated branches in local and remote repositories article Lists all branches that have been merged.
git-move-commits Corey Oordt's git-scripts git move-commits num-commits correct-branch moves the last n commits to correct-branch (creating it if necessary).
git-neck Leah Neukirchen's blog Show commits from the HEAD until the first branching point. Companion script for git-trail.
git-nuke Zach Holman's dotfiles Nukes a branch locally and on the origin remote.
git-object-deflate Ryan Tomayko's dotfiles Deflate an loose object file and write to standard output.
git-oldest-common-ancestor Lee Dohm's dotfiles Finds the oldest common ancestor commit between two branches.
git-open-jira If the branch name starts with JIRAPROJECT-NNNN, will open that issue in jira. Assumes that your JIRA server location is in ~/.jira-server or in the $JIRA_SERVER environment variable.
git-origin-head Don't recall, maybe twitter Prints the name of the origin remote's default branch. Not every repository uses main or master.
git-outgoing Michael Markert's dotfiles Show commits that are on the local branch that have not been pushed to the tracking branch.
git-overwritten Mislav Marohnić's dotfiles Aggregates git blame information about original owners of lines changed or removed in the '...' diff.
git-pie-ify JeeBak Kim's gist git pie-ify pattern replacement
git-plotrepo Matthew McCullogh's scripts collection Uses dot to draw a graph of the repository.
git-pr-fetch Joe Block [email protected] Fetch PR branches by refspec from one of a repository's remotes.
git-pr-list Joe Block [email protected] Lists pull requests. Requires gh.
git-promote Trevor's Improving My git Workflow blog post (404 now) Promotes a local topic branch to a remote tracking branch of the same name.
git-prune-branches Michael Demmer in jut-io/git-scripts Deletes each fully merged branch after prompting for confirmation, than asks if you want the deleted branches deleted from your upstream remotes.
git-pruneall Ryan Tomayko's dotfiles Prune branches from specified remotes, or all remotes when no remote is specified.
git-publish Michael Markert's dotfiles git publish remote [remote-branch].
git-purge-from-history David Underhill’s blog Permanently delete files or folders from your git repository.
git-pylint Joe Block [email protected] Runs pylint on any .py files modified or added in the git status output.
git-rank-contributors William Morgan [email protected] Rummages through the changelog and orders contributors by the size of the diffs they're responsible for.
git-rebase-authors Mislav Marohnić's dotfiles Adds authorship info to interactive git rebase output.
git-rebase-theirs Rodrigo Silva (MestreLion) [email protected] Resolve rebase conflicts by favoring 'theirs' version.
git-recent Mine Shows information about most recent commit on all local branches.
git-recently-checkedout-branches Mislav Marohnić's dotfiles Shows timestamp and name of recently checked-out branches in reverse chronological order.
git-ref-recent Y combinator article Shows the date, branch name, commit hash, and commit subject of branches, from most recently modified to oldest branches.
git-rel Ryan Tomayko's dotfiles Shows the relationship between the current branch and ref. With no ref, the current branch's remote tracking branch is used.
git-related Mislav Marohnić's dotfiles Show other files that often get changed in commits that touch <file>.
git-release-tag Mislav Marohnić's dotfiles Create a GitHub release for a specified tag. The release notes are automatically populated with the contents of git log since the last tagged version.
git-remote-default-branch Mine Shows the default branch for a specified remote, defaults to origin when no remote is specified.
git-remove-conflicts ours or theirs FILES... John Wiegley's git scripts Automatically resolves conflicts by applying the changes from current branch (ours) or remote branch (theirs).
git-rename-branches Rodrigo Silva (MestreLion) [email protected] Rename multiple branches that start with a given name.
git-replace-author Stack Overflow Uses git-filter-branch to rewrite all commits with one name to use another name and email.
git-reset-with-fire Joe Block [email protected] Hard reset the working directory, then zap any files not known to git.
git-restore-mtime Rodrigo Silva (MestreLion) [email protected] Change mtime of files based on commit date of last change.
git-reup Zach Holman's dotfiles Like git pull but show a short and sexy log of changes after merging or rebasing.
git-rm-deleted-from-repo Joe Block [email protected] Removes files you deleted with rm from the repository for you.
git-root-directory Joe Block [email protected] Prints the path to the root of the git repository you're in.
git-run-command-on-revisions Gary Bernhardt's dotfiles Runs a given command over a range of git revisions.
git-shamend Danielle Sucher's git-shamend blog post Amends your staged changes as a fixup (keeping the pre-existing commit message) to the specified commit, or HEAD if no revision is specified.
git-show-overwritten Mislav Marohnić's dotfiles Aggregates git blame information about the original owners of lines changed or removed in the '...' diff.
git-shrink-repo Based on gimbo/gimbo-git.zsh Shrinks your clone of a git repository.
git-side-by-side Greg V's vmware-archive/git_scripts @hefeweizen on the coffeeops slack
git-sp A. Schwarz's git-sp "Simple push", single short command to commit, and push. Use -a flag to add all files to commit.
git-sr Noel Cower's git-sr Use fzf to switch to a different git ref.
git-stats Jake Zimmerman's blog Displays stats for the files different between the current branch and $REVIEW_BRANCH, which if unset defaults to the repository's default branch.
git-submodule-ls List all submodules in your project
git-submodule-paths git-submodule --help Show path to all submodules in your checkout, with their current commit SHA
git-submodule-rm Greg V's dotfiles & Pascal Sommer Allows you to remove a submodule easily with git submodule-rm path/to/submodule.
git-superpull Greg V's vmware-archive/git_scripts Pulls, then does a git submodule init and git submodule update.
git-switch-branch Andrew Steele's dotfiles Make it easier to switch to a branch by a substring of its name. More useful if you are good about deleting branches which have been merged upstream and if your branch names include unique identifiers like ticket/issue numbers or feature names.
git-tag-and-sign ? Create and sign a new tag.
git-tag-diff John Wiegley's git-scripts Show the differences between local tags and ones on the remote, if any.
git-thanks Mislav Marohnić's dotfiles List the contributors to a repository in descending commit order, even if their contribution has been completely replaced.
git-track Zach Holman's dotfiles Sets up your branch to track a remote branch. Assumes you mean origin/localbranchname.
git-trail Leah Neukirchen's blog Show all branching points in the repository's git history so you can see how to reach commits in the current branch from other branches.
git-undelete ? Undeletes a file.
git-undo-push ? Undoes your last push to branch $1 of origin.
git-undo Stack Overflow Undoes your last commit but keeps the changes in place.
git-unpushed Zach Holman's dotfiles Show the diff of everything you haven't pushed to the origin remote yet.
git-unreleased Mislav Marohnić's dotfiles Shows git commits since the last tagged version.
git-up Zach Holman's dotfiles Like git pull but show a short and sexy log of changes after merging or rebasing.
git-upstream-name Joe Block [email protected] Print the name of the current branch's upstream.
git-upstream-sync Joe Block [email protected] Fetches upstream/yourforkname and rebases it into your local fork, then pushes to your origin remote.
git-what-the-hell-just-happened Gary Bernhardt's dotfiles Show what just happened.
git-when-merged Michael Haggerty git-when-merged Find when a commit was merged into one or more branches.
git-where-pr Mislav Marohnić's dotfiles Opens the Pull Request on GitHub where a specified commit originated.
git-where Mislav Marohnić's dotfiles Shows where a particular commit falls between releases.
git-whoami Peter Eisentraut Shows what username & email you have configured for the repository you're in.
git-winner Garry Dolley https://github.com/up_the_irons/git-winner Shows what authors have made the most commits, both by number of commits and by number of lines changed.
git-wordiness Noel Cower Shows how wordy people's commit messages are. Useful for shaming the folks who commit atrocities like git commit -m fixup.
git-wtf William Morgan [email protected] git-wtf displays the state of your repository in a readable, easy-to-scan format. It's useful for getting a summary of how a branch relates to a remote server, and for wrangling many topic branches.

Useful git aliases

Here are some helpful aliases for your ~/.gitconfig

alias Description
ahead-of-master = log --oneline origin/master..HEAD Show commits that haven't made it to master yet.
fetch-pull-requests = fetch origin '+refs/pull/*/head:refs/remotes/origin/pull/*' Fetch pull requests from GitHub so you can git checkout pull/123 and test them locally.
roots = log --all --oneline --decorate --max-parents=0 Show the root commits.
unpushed = log @{u}.. Show which commits have not been pushed to the tracking branch and are safe to amend/rebase.
work-in-progress = rebase -i @{u} Starts an interactive rebase of all the commits you haven't pushed yet. Handy for collapsing a bunch of work-in-progress snapshots into logical commits before pushing, without having to worry about accidentally squashing a commit someone else has already referred to.

Installing

Pre-requisites

  • A relatively recent version of git. The version of git Apple includes in macOS is very stale. You should really brew install git to get the current version if you're on macOS - if not for features, for security updates.
  • Python 3+
  • Ruby 2.2+

Zgenom

If you're using Zgenom:

  1. Add zgenom load unixorn/git-extra-commands to your .zshrc along with your other zgenom load commands.
  2. zgenom reset && zgenom save

Antigen

If you're using Antigen:

  1. Add antigen bundle unixorn/git-extra-commands@main to your .zshrc where you've listed your other plugins.
  2. Close and reopen your Terminal/iTerm window to refresh context and use the plugin. Alternatively, you can run antigen bundle unixorn/git-extra-commands in a running shell to have antigen load the new plugin.

oh-my-zsh

If you're using oh-my-zsh:

  1. Clone the repository into a new git-extra-commands directory in oh-my-zsh's plugin folder:

git clone https://github.com/unixorn/git-extra-commands.git $ZSH_CUSTOM/plugins/git-extra-commands

  1. Edit your ~/.zshrc and add git-extra-commands – same as clone directory – to the list of plugins to enable:

plugins=( ... git-extra-commands )

  1. Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:

source ~/.zshrc

Bash / Manual Installation

Nothing here actually requires you to use ZSH or zgen, that's just a convenient distribution method for anyone using a ZSH framework.

If you aren't using any ZSH frameworks, or if you're using bash, fish or another shell, do the following steps:

  1. git clone this repository
  2. Add cloneDirectory/bin to your $PATH in your shell's startup file.

Other useful git stuff

Articles / Blog posts / Books

External Git Utilities

  • bfg repo-cleaner - Removes large or troublesome blobs like git filter-branch does, but faster.
  • bitbucket-git-helpers - Helper scripts to allow you to create bitbucket PRs from a shell session.
  • blackbox - Tom Limoncelli open sourced the tool they use at Stack Exchange to use GPG to store secrets in a git repository.
  • branch-manager - ZSH plugin for branch management
  • commit-helper - A python script that helps you write commits following commit conventions.
  • diff-so-fancy - Better looking git diffs.
  • dunk - Another tool for prettier git diffs.
  • gig - a CLI .gitignore generator
  • git ZSH plugin - A replacement for the stock oh-my-zsh git plugin. Provides quite a few useful aliases and functions that are more consistent in their naming that the relatively unintuitive ones in the stock plugin.
  • git-absorb - Essentially, when your working directory has uncommitted changes on top of draft changesets, you can run git absorb and the uncommitted modifications are automagically folded ("absorbed") into the appropriate draft ancestor commits. The command essentially looks at the lines that were modified, finds a commit modifying those lines, and amends that commit to include your uncommitted changes. If the changes can't be made without conflicts, they remain uncommitted. This workflow is insanely useful for things like applying review feedback.
  • git-activity - Displays an activity graph (like the contribution graph on GitHub) for the current git repository and branch.
  • git-aliases.zsh - Peter Hurford's git plugin which you may prefer to the git plugin from oh-my-zsh.
  • git-also - Shows what files are most often committed with a given file in the repository.
  • git-amend - Bash script to amend older commits with staged changes.
  • git-branch-status - A git utility to make managing large number of branches either across many remotes easier. Branch status allows comparing all branches against their upstream or any arbitrary branch to show the number of commit differences.
  • git-branches - Prints the commit behind/ahead counts for branches.
  • git-bump - Hook scripts to automatically bump the version file in a repository
  • git-chart - A python script that builds charts from a git repository
  • git-clean-branch - Cleans up dead git branches.
  • git-cliff - git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.
  • git-complete-urls - ZSH plugin to enhance git tab completion to include in the remotes completion (e.g. from git clone) any URL in the clipboard.
  • git-crypt - Enables transparent encryption and decryption of files in a git repository. Files which you choose to protect are encrypted when committed, and decrypted when checked out.
  • git-deploy-s3 - Keeps your git repository's assets in sync with Amazon S3.
  • git-diffall - Provides a directory based diff mechanism for git.
  • git-extend - Extend git builtins with command wrappers.
  • git-fastclone - Think git clone --recursive on steroids. If you're doing repeated checkouts of a given repository on a machine (like a ci box), git-fastclone will speed things up considerably.
  • git-flow-completion - Bash, Fish and ZSH completion support for git-flow
  • git-follow - Follow lifetime changes of a pathspec.
  • git-fuzzy - A CLI interface to git that relies heavily on fzf.
  • git-graph - creates a Graphviz graph showing the high-level structure of a repository's history.
  • git-gutter - Plugin for Sublime Text 2/3 to display the git diff in the edit window gutter.
  • git-it-on.zsh - Another plugin by Peter Hurford that adds a gitit command that will open your current directory on github, in your current branch. Also works with private GitHub servers.
  • git-lint - Enforces git rebase workflow with consistent commits for a clean and easy to read/debug project history.
  • git-prompt-kit - A configurable set of components for creating feature rich, high performance Git-aware zsh prompts (aka themes) with minimal coding.
  • git-quick-stats - A simple and efficient way to access various statistics in a git repository.
  • git-repo-updater - Allows you to easily update multiple git repositories at once.
  • git-secrets - Prevents you from committing secrets and credentials into git repositories.
  • git-standup - Recall what you did on the last working day. Can work in a directory full of git repositories to see a consolidated view of all work in all the repositories.
  • git-stashd - Autostashing daemon for dirty worktrees.
  • git-submodule-tools - A collection of scripts that should help make life with git submodules easier.
  • git-sweep - A utility script to remove branches that have been merged to master.
  • git-todo - helper script to show all the todo entries in your repository.
  • git-up (gem) - Fetch and rebase all locally-tracked remote branches.
  • git-up (python) - Python implementation of Aanand's original ruby gem
  • git-wayback-machine - A simple script to quickly navigate a project's state through it's git history
  • git-worktree - ZSH plugin that wraps git worktree for ease of use.
  • git_history_visualizer - python script to visualize the history of files in a git repository
  • gitgo - Open a GitHub/Gitlab hosted repository in your browser via the command-line (macOS only).
  • gitsh - An interactive shell for git. From within gitsh you can issue any git command, even using your local aliases and configuration.
  • gunstage - There are at least eight ways to unstage files in a git repository. This is a command-line shell plugin for undoing git add.
  • hitch - Allows developers to be properly credited when Pair Programming and using git.
  • hub - A command-line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier.
  • igit - Interactively construct git commands using fzf.
  • joe - Generates .gitignore files from the command-line for you.
  • mergepbx - Helper script for merging XCode project files.
  • more-hooks-for-git - Adds extra hooks for git add, git diff and git status.
  • switch-git - Easy switching between git repositories. Just type sgr <some part of you repo's name>, press enter and you're there.
  • ugit - Lets you undo your last git operation.
  • worktree - Adds functions that wrap git worktree.
  • xcode-build-scripts - Helper scripts to use with XCode projects.

Miscellaneous Tips

Make it easier to check out default branch

Many repositories are switching away from using master as the default branch name. You can do git config --global alias.co-default '!'"git checkout \$(git branch -r | awk -F/ '/HEAD/ {print \$NF}')" to add a co-default alias that will determine what the repository's default branch is for you.

Alternatively, add the following aliases from a tweet by @jnesselr to your .gitconfig file:

cdef = "!git checkout $(git originhead)"
originhead = "!git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5"

This queries the remote to get the current up to date default branch, so it will work even if the remote's default branch changes after you did your initial checkout.

Have git cope with typos

Do git config --global help.autocorrect 1

git will now try to figure out what you meant, for example:

$ git commt
WARNING: You called a Git command named 'commt', which does not exist.
Continuing in 0.1 seconds, assuming that you meant 'commit'.

Rewrite git:// with https://

git config --global url."https://github".insteadOf git://github

or replace with ssh

Use ssh instead of https://

git config --global url."[email protected]:".insteadOf "https://github.com/"

Credit: @grawity & @hansdg1 by way of @Kovrinic's gist

Contributing

  • Please include an entry both in the credits section of README.md for any scripts and a credit comment in the script itself in your PRs so authors get their work credited correctly.
  • Please use #!/usr/bin/env interpreter instead of a direct path to the interpreter, this makes it easier for people to use more recent versions when the ones packaged with their OS (macOS and CentOS, I'm looking at you!) are stale.

Thanks

Many thanks to all the contributors over the years.

Made with contributors-img.

More Repositories

1

awesome-zsh-plugins

A collection of ZSH frameworks, plugins, themes and tutorials.
Shell
13,445
star
2

zsh-quickstart-kit

A simple ZSH quickstart for using ZSH, zgenom, oh-my-zsh and a curated list of extra plugins. It is designed to be easy to customize without requiring you to maintain your own fork.
Shell
680
star
3

sysadmin-reading-list

A reading and viewing list for larval stage sysadmins and SREs
472
star
4

luggage

Project to automate OS X package creation without using the packagemaker GUI
Makefile
391
star
5

fzf-zsh-plugin

ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.
Shell
154
star
6

tumult.plugin.zsh

Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Shell
153
star
7

aws-lambda-list

A list of hopefully useful AWS lambdas and lambda-related resources.
141
star
8

lima-xbar-plugin

xbar/Swiftbar plugin to control lima-vm
Python
81
star
9

works-with-home-assistant

Equipment and software that works with Home Assistant. And stuff that didn't so we can avoid it.
63
star
10

luggage-examples

Example luggage packages
Makefile
60
star
11

warhol.plugin.zsh

Colorize command output using grc and lscolors
Shell
55
star
12

chocolate-factory-engineering-docs

A collection of hopefully useful document templates for engineering orgs
39
star
13

autoupdate-antigen.zshplugin

Add automatic updating to antigen
Shell
27
star
14

docker-helpers.zshplugin

Miscellaneous utility scripts and aliases for use with Docker.
Shell
26
star
15

ha-mqtt-discoverable

Python module to create MQTT entities that are automatically discovered by Home Assistant
Python
23
star
16

autoupdate-zgen

Autoupdate plugin for zgen
Shell
20
star
17

jpb.zshplugin

ZSH plugin to load some of my tools.
Shell
20
star
18

bitbucket-git-helpers.plugin.zsh

Add some git helper scripts for dealing with repos on bitbucket
Ruby
17
star
19

jira-commands

Some command-line tools for interacting with JIRA
Python
16
star
20

osxtoolkit

Miscellaneous scripts to make OS X administration easier.
Ruby
13
star
21

rake-completion.zshplugin

rake task tab completion plugin for zsh, suitable for use with zgen and other oh-my-zsh compatible frameworks
Shell
8
star
22

apgar

Apgar is a quick and dirty health checker driver written in go.
Go
8
star
23

kubectx-zshplugin

Loads kubectx and kubens automagically for you
Shell
7
star
24

1password-op.plugin.zsh

ZSH plugin to load completions and aliases for 1Password's `op` tool
Shell
7
star
25

bigriver-tools

Some scripts for dealing with AWS
Python
6
star
26

docker-cupsd

cupsd in a docker container
Dockerfile
6
star
27

osx-dmg-tests

Making a separate repo for the disk image test suite that was in the pymacadmin project. No good reason other than that I don't like kitchen sink repos, this one is just the disk tests.
Python
6
star
28

gitlike-commands

Easy python module for creating git-style subcommand handling.
Python
6
star
29

containerized-awscli

Run the aws cli in a container
Shell
5
star
30

ocr-screenshots-macos

OCR all your screenshots automagically
Ruby
4
star
31

blog-scripts

Scripts from my blog
Shell
3
star
32

online-devops-meetups

Free online devops meetups.
3
star
33

logrus

A collection of random utility functions
Python
3
star
34

sourdough

Chef auto-self-registry tooling
Python
3
star
35

rvm-plugin

Autoload rvm if present
Shell
3
star
36

ha-mqtt-discoverable-cli

A cli for creating Home Assistant compatible MQTT entities that will be automatically discovered.
Python
2
star
37

ec2-tagread

Helper script to let bash scripts read EC2 tags
Python
2
star
38

thoth-duplicacy

Container for duplicacy and duplicacy-utils
Shell
2
star
39

thelogrus

Python 3 version of logrus
Python
2
star
40

haze

Some EC2 utility functions and scripts
Python
2
star
41

unixorn.github.io

HTML
2
star
42

doctoc-docker

Docker container for running doctoc
Ruby
2
star
43

SetupSSHonAMIs

I needed to create an AWS marketplace AMI at work, so the instances needed to get their authorized_keys set from the keypair specified to AWS.
Ruby
2
star
44

shellshock-patch-osx

This will download Apple's bash source, patch it, build it, and create a pkg file for you
2
star
45

rage-quit.plugin.zsh

Perl
2
star
46

jpb-utilities

Various utility scripts
Python
1
star
47

zsh-starterkit

zsh is great. starterkit makes it even better. start with omz and add this plugin to get great defaults.
Shell
1
star
48

docker-masquerade

ZSH Plugin full of shim scripts that run commands in docker containers instead of natively
Shell
1
star
49

poseidon

Kubernetes utility scripts
1
star
50

zsh-lunch-and-learn

Lunch and learn about ZSH
JavaScript
1
star
51

slackmoji

Random useful images for slack emoji.
1
star
52

k8s-helpers.zshplugin

Some helper functions I use with kubernetes
Shell
1
star
53

elasticsearch-shell-helpers

Helper scripts for elasticsearch
Shell
1
star
54

home-assistant-to-twilio-sms

Shell
1
star
55

arm-toolkit

Some scripts I like to have on my ARM cluster nodes
Perl
1
star
56

chef-valkyrie

chef-valkyrie purges dead EC2 instances from your Chef Server
Python
1
star
57

pyvizio-docker

pyvisio in a docker container
Ruby
1
star
58

pdcrier

Create/update PagerDuty alerts from the command line
Python
1
star
59

throttle.zsh-plugin

Limit the amount of CPU an application can gobble up on macOS
1
star
60

clio

Docker container for backing up local directories
1
star
61

twilio-sms-zsh-plugin

Adds tooling so you can send an SMS from the command line using Twilio's API
1
star
62

alpython2

alpine + Python 2 + Upgraded pip
Ruby
1
star
63

cookiecutter-zsh-plugin

Template create zsh plugin with cookiecutter
Makefile
1
star
64

ha-franklin

Monitor cupsd print queues and present the information to Home Assistant via MQTT
Python
1
star
65

sysadvent.plugin.zsh

Functions from sysadvent
1
star
66

grok-burnrate

Burnrate custom metric for Grok
Python
1
star
67

themis-lambda

Lambda function to scan an ASG for busy instances and set instance protection on them
Python
1
star
68

unixorn-py3

Python 3 base container
Ruby
1
star
69

history-search-multi-word

Multi-word history searching for Zsh
Shell
1
star
70

autoupdate-zgenom

ZSH Plugin for updating zgenom and its plugins
Shell
1
star