{"id":24794312,"url":"https://github.com/eckertalex/git.plugin.zsh","last_synced_at":"2026-05-08T13:45:54.560Z","repository":{"id":127979842,"uuid":"604642807","full_name":"eckertalex/git.plugin.zsh","owner":"eckertalex","description":"zsh aliases for common git commands ","archived":false,"fork":false,"pushed_at":"2023-03-15T14:20:19.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T22:44:57.211Z","etag":null,"topics":["git","productivity","terminal","zsh-aliases","zsh-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eckertalex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-21T13:48:45.000Z","updated_at":"2023-02-21T13:51:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"24e4c5f5-8641-4dc8-af9e-0c515c3a9198","html_url":"https://github.com/eckertalex/git.plugin.zsh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckertalex%2Fgit.plugin.zsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckertalex%2Fgit.plugin.zsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckertalex%2Fgit.plugin.zsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eckertalex%2Fgit.plugin.zsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eckertalex","download_url":"https://codeload.github.com/eckertalex/git.plugin.zsh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245325223,"owners_count":20596818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","productivity","terminal","zsh-aliases","zsh-plugin"],"created_at":"2025-01-29T22:36:11.977Z","updated_at":"2026-05-08T13:45:49.531Z","avatar_url":"https://github.com/eckertalex.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git.plugin.zsh\n\n\u003e A git aliases plugin for zsh\n\n## Installation\n\n### Znap\n\nI recommend using [Znap](https://github.com/marlonrichert/zsh-snap) or installing the plugin manually. You can also install it using any 3rd-party framework or plugin manager you like, but I won't document that here.\n\nJust add this to your .zshrc file:\n\n`znap source eckertalex/git.plugin.zsh`\n\nTo update, run `znap pull`.\n\n### Oh My Zsh\n\n1. Clone the repository:\n\n   `git clone --depth=1 https://github.com/eckertalex/git.plugin.zsh.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/git`\n\n2. Include it in your `~/.zshrc`\n\n   `plugins=(... git)`\n\n## Default branch name\n\n`git.plugin.zsh` respects `init.defaultBranch` setting that was [introduced in git 2.28](https://github.blog/2020-07-27-highlights-from-git-2-28/#introducing-init-defaultbranch).\nThe order for resolving the default branch name is as follows:\n\n1. `init.defaultBranch` if it is set and the branch exists\n2. `main` if it exists\n3. `master` as fallback\n\n## Usage\n\n### Status\n\n| Alias | Command         | Description                                  |\n| ----- | --------------- | -------------------------------------------- |\n| `gst` | `git status`    | Show the working tree status                 |\n| `gss` | `git status -s` | Show the working tree status in short-format |\n\n### Branch\n\n| Alias   | Command                                     | Description                                                     |\n| ------- | ------------------------------------------- | --------------------------------------------------------------- |\n| `gb`    | `git branch -vv`                            | Show all local branches with last commit message                |\n| `gba`   | `git branch -a -v`                          | Show all branches with last commit message                      |\n| `gbd`   | `git branch -d`                             | Delete branch                                                   |\n| `gbd!`  | `git branch -D`                             | Force delete branch                                             |\n| `gbage` |                                             | list local branches and display their age                       |\n| `gbsup` | git set upstream to origin/_current-branch_ | Set upstream to origin/_current_branch_                         |\n| `gbmv`  |                                             | Rename _old_ branch to _new_ branch, including in origin remote |\n\n### Local Files\n\n| Alias   | Command                           | Description                                                                                                  |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------ |\n| `ga`    | `git add`                         | Add file contents to the index                                                                               |\n| `gaa`   | `git add --all`                   | Add all file contents to the index                                                                           |\n| `gau`   | `git add --update`                | Update the index just where it already has a matching entry                                                  |\n| `gapa`  | `git add --patch`                 | Interactively choose hunks of patch between the index and the work tree                                      |\n| `grm`   | `git rm`                          | Removes file from the working tree and the index                                                             |\n| `grmc`  | `git rm --cached`                 | Removes file from the index                                                                                  |\n| `grs`   | `git restore`                     | _Discard_. Restore the worktree for matching paths                                                           |\n| `grss`  | `git restore --source`            | Restore from a different commit                                                                              |\n| `grst`  | `git restore --staged`            | _Unadd_. Reset the index for matching paths. Same as `git reset`                                             |\n| `grst!` | `git restore --staged --worktree` | _Unadd and discard_. Reset the index and restore the worktree for matching paths. Same as `git reset --hard` |\n\n### Clean\n\n| Alias      | Command                            | Description                                                                                                    |\n| ---------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------- |\n| `gclean`   | `git clean -di`                    | Delete all untracked files. Ignored files will be untouched                                                    |\n| `gclean!`  | `git clean -dfx`                   | Delete all untracked and ignored files                                                                         |\n| `gclean!!` | `git reset --hard; git clean -dfx` | _Unadd, discard, and clean_. Reset the index, restore the worktree, and delete all untracked and ignored files |\n\n### Reset\n\n| Alias  | Command                   | Description                                                     |\n| ------ | ------------------------- | --------------------------------------------------------------- |\n| `grh`  | `git reset HEAD~1`        | _Uncommit_. Remove last commit and keep worktree                |\n| `grh!` | `git reset --hard HEAD~1` | _Uncommit and discard_. Remove last commit and discard worktree |\n\n### Commit\n\n| Alias   | Command                                | Description                                                   |\n| ------- | -------------------------------------- | ------------------------------------------------------------- |\n| `gc`    | `git commit -v`                        | Commit changes in index                                       |\n| `gc!`   | `git commit -v --amend`                | Amend last commit                                             |\n| `gcn!`  | `git commit -v --amend --no-edit`      | Amend last commit, don't edit commit message                  |\n| `gca`   | `git commit -v -a`                     | Commit all changes                                            |\n| `gca!`  | `git commit -v -a --amend`             | Amend last commit with all changes                            |\n| `gcan!` | `git commit -v -a --no-edit --amend`   | Amend last commit with all changes, don't edit commit message |\n| `gcv`   | `git commit -v --no-verify`            | Commit changes in index, don't run pre-push hook              |\n| `gcav`  | `git commit -v -a --no-verify`         | Commit all changes, don't run pre-push hook                   |\n| `gcav!` | `git commit -v -a --no-verify --amend` | Amend last commit with all changes, don't run pre-push hook   |\n| `gcm`   | `git commit -m`                        | Commit changes in index with commit message                   |\n| `gcam`  | `git commit -a -m`                     | Commit all changes with commit message                        |\n\n### Checkout\n\n| Alias  | Command                             | Description                                   |\n| ------ | ----------------------------------- | --------------------------------------------- |\n| `gco`  | `git checkout`                      | Switch branches or restore working tree files |\n| `gcob` | `git checkout -b`                   | Swtich and create a new branch                |\n| `gcom` | `git checkout (git_default_branch)` | Switch to default branch                      |\n| `gco-` | Checkout previous                   | Switch to previous branch/commit              |\n| `gsw`  | `git switch`                        | Switch branches                               |\n| `gswc` | `git switch -c`                     | Switch an create and new branch               |\n| `gswm` | `git switch (git_default_branch)`   | Switch to default branch                      |\n| `gsw-` | `git switch (git_default_branch)`   | Switch to previous branch/commit              |\n\n### Fetch\n\n| Alias | Command                   | Description                                                                                        |\n| ----- | ------------------------- | -------------------------------------------------------------------------------------------------- |\n| `gf`  | `git fetch`               | Fetch objects and refs                                                                             |\n| `gfa` | `git fetch --all --prune` | Fetch from all remotes, before fetching remove any remote-tracking references that no longer exist |\n| `gfo` | `git fetch origin`        | Update the remote-tracking branches from origin                                                    |\n\n## Push\n\n| Alias   | Command                                   | Description                                      |\n| ------- | ----------------------------------------- | ------------------------------------------------ |\n| `gp`    | `git push`                                | Update remote refs along with associated objects |\n| `gp!`   | `git push --force-with-lease`             | Force push                                       |\n| `gpo`   | `git push origin`                         | Push to origin                                   |\n| `gpo!`  | `git push --force-with-lease origin`      | Force push to origin                             |\n| `gpv`   | `git push --no-verify`                    | Push, don't run pre-push hook                    |\n| `gpv!`  | `git push --no-verify --force-with-lease` | Force push, run pre-push hook                    |\n| `ggp`   | push origin _current-branch_              | Push current branch to origin                    |\n| `ggp!`  | `ggp --force-with-lease`                  | Force push current branch to origin              |\n| `ggpu`  | `ggp --set-upstream`                      | Push and set upstream                            |\n| `gpoat` |                                           | push all + tags to origin                        |\n\n### Pull\n\n| Alias   | Command                         | Description                                                              |\n| ------- | ------------------------------- | ------------------------------------------------------------------------ |\n| `gpl`   | `git pull`                      | Fetch from and integrate with another repository or a local branch       |\n| `ggpl`  | pull origin _current-branch_    | Pull current branch from origin                                          |\n| `gplr`  | `git pull --rebase`             | Pull and reconcile by rebase                                             |\n| `gplra` | `git pull --rebase --autostash` | Pull and reconcile by rebase, automatically create temporary stash entry |\n\n### Diff\n\n| Alias  | Command                                       | Description                                                |\n| ------ | --------------------------------------------- | ---------------------------------------------------------- |\n| `gd`   | `git diff`                                    | Show changes between commits, commit and working tree, etc |\n| `gds`  | `git diff --stat`                             | Show diff with stats                                       |\n| `gdc`  | `git diff --cached`                           | Show index diff                                            |\n| `gdsc` | `git diff --stat --cached`                    | Show index diff with stats                                 |\n| `gdt`  | `git diff-tree --no-commit-id --name-only -r` | list changed files                                         |\n| `gdw`  | `git diff --word-diff`                        | Show word diff                                             |\n| `gdwc` | `git diff --word-diff --cached`               | Show index word diff                                       |\n| `gdto` | `git difftool`                                | Show changes using common diff tools                       |\n\n### Log\n\n| Alias    | Command                                                                                     | Description                                                         |\n| -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |\n| `glo`    | `git log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short` | Shows one line commit log with short date                           |\n| `glg`    | `git log --stat`                                                                            | Shows commit log with stats                                         |\n| `glgg`   | `git log --graph`                                                                           | Shows commit log with a graph                                       |\n| `glgga`  | `git log --graph --decorate --all`                                                          | Shows all commit logs with a graph                                  |\n| `glom`   | `git log --oneline --decorate --color (git_default_branch)..`                               | Shows one line commit log since branching from _git_default_branch_ |\n| `gcount` | `git shortlog -sn`                                                                          | Summarizes commit count by author                                   |\n\n### Rebase\n\n| Alias   | Command                                         | Description                                |\n| ------- | ----------------------------------------------- | ------------------------------------------ |\n| `grb`   | `git rebase`                                    | Reapply commits on top of another base tip |\n| `grbi`  | `git rebase --interactive`                      | Rebase interactively                       |\n| `grba`  | `git rebase --abort`                            | Abort the rebase                           |\n| `grbc`  | `git rebase --continue`                         | Continue the rebase                        |\n| `grbs`  | `git rebase --skip`                             | Skip the rebase                            |\n| `grbm`  | `git rebase (git_default_branch)`               | Rebase with default branch                 |\n| `grbmi` | `git rebase (git_default_branch) --interactive` | Rebase with default branch interactively   |\n\n### Stash \u0026 Work in Progress\n\n| Alias    | Command                 | Description                                                                                                                                    |\n| -------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |\n| `gsta`   | `git stash`             | Stash the changes in a dirty working directory away                                                                                            |\n| `gstd`   | `git stash drop`        | Remove a single stash entry from the list of stash entries                                                                                     |\n| `gstl`   | `git stash list`        | List the stash entries that you currently have                                                                                                 |\n| `gstp`   | `git stash pop`         | Remove a single stashed state from the stash list and apply it on top of the current working tree state                                        |\n| `gsts`   | `git stash show --text` | Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created |\n| `gwip`   |                         | commit a work-in-progress branch                                                                                                               |\n| `gunwip` |                         | uncommit the work-in-progress branch                                                                                                           |\n\n### Cherry-pick\n\n| Alias  | Command                      | Description                                           |\n| ------ | ---------------------------- | ----------------------------------------------------- |\n| `gcp`  | `git cherry-pick`            | Apply the changes introduced by some existing commits |\n| `gcpa` | `git cherry-pick --abort`    | Abort the cherry-pick                                 |\n| `gcpc` | `git cherry-pick --continue` | Continue the cherry-pick                              |\n| `gcps` | `git cherry-pick --skip`     | Skip the cherry-pick                                  |\n\n### Bisect\n\n| Alias  | Command            | Description                                                |\n| ------ | ------------------ | ---------------------------------------------------------- |\n| `gbs`  | `git bisect`       | Use binary search to find the commit that introduced a bug |\n| `gbss` | `git bisect start` | Start bisecting                                            |\n| `gbsb` | `git bisect bad`   | Mark commit as bad                                         |\n| `gbsg` | `git bisect good`  | Mark commit as good                                        |\n| `gbsr` | `git bisect reset` | Reset bisecting                                            |\n\n### Remote\n\n| Alias   | Command                   | Description                                     |\n| ------- | ------------------------- | ----------------------------------------------- |\n| `gr`    | `git remote -vv`          | Manage set of tracked repositories              |\n| `gra`   | `git remote add`          | Add a remote                                    |\n| `grmv`  | `git remote rename`       | Rename a remote                                 |\n| `grpo`  | `git remote prune origin` | Deletes stale references associated with origin |\n| `grrm`  | `git remote remove`       | Remove the remote                               |\n| `grset` | `git remote set-url`      | Changes URLs for the remote                     |\n| `grup`  | `git remote update`       | Fetch updates                                   |\n\n### Tags\n\n| Alias | Command              | Description                     |\n| ----- | -------------------- | ------------------------------- |\n| `gt`  | `git tag`            | Create, list, delete            |\n| `gtl` | `git tag --list`     | List all tags                   |\n| `gtd` | `git tag -d`         | Delete a tag                    |\n| `gtv` | `git tag \\| sort -V` | List all tags sorted by version |\n\n### Miscellaneous\n\n| Alias  | Command             | Description                                                     |\n| ------ | ------------------- | --------------------------------------------------------------- |\n| `g`    | `git`               | The `git` command                                               |\n| `gcl`  | `git clone`         | Clone a repository into a new directory                         |\n| `gm`   | `git merge`         | Join two or more development histories together                 |\n| `gbl`  | `git blame -b -w`   | Show what revision and author last modified each line of a file |\n| `gcf`  | `git config`        | Get and set repository or global options                        |\n| `gcfl` | `git config --list` | List all config entries                                         |\n\n## Changelog\n\n### 2023-03-15\n\n- fix bug renaming a branch caused by single quotes\n- remove undefined alias for `gignored`\n\n### 2023-02-21\n\n- Initial commit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckertalex%2Fgit.plugin.zsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feckertalex%2Fgit.plugin.zsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckertalex%2Fgit.plugin.zsh/lists"}