Provides handy Git aliases and functions.
Many thanks to Sorin Ionescu for the excellent original aliases.
Gis short forgit.
Gblists, creates, renames, and deletes branches.Gbccreates a new branch.Gbddetaches HEAD at the tip of the current or given branch.Gbllists branches and their commits.GbLlists local and remote branches and their commits.Gbmrenames a branch.GbMrenames a branch even if the new branch name already exists.GbRresets a branch even if the branch name already exists.Gbslists branches and their commits with ancestry graphs.GbSlists local and remote branches and their commits with ancestry graphs.Gbuunsets the remote-tracking information for the current or given branch.GbGdeletes all local branches tracking remote branches that are gone.Gbxdeletes a branch.GbXdeletes a branch irrespective of its merged status.
Gcrecords changes to the repository.Gcacommits all modified and deleted files.GcAcommits all modified and deleted files interactively.Gcmcommits with the given message.Gcochecks out a branch or paths to the working tree.GcOchecks out hunks from the index or the tree interactively.Gcfamends the tip of the current branch reusing the same log message as HEAD.GcFamends the tip of the current branch.Gcpapplies changes introduced by existing commits.GcPapplies changes introduced by existing commits without committing.Gcrreverts existing commits by reverting patches and recording new commits.GcRremoves the HEAD commit.Gcsshows one or more objects (blobs, trees, tags and commits).GcScommits with GPG signature.Gcucommits with fixup message using given commit.GcUcommits with squash message using given commit.Gcvverifies the GPG signature of commits.
GCllists unmerged files.GCaadds unmerged file contents to the index.GCeexecutes merge-tool on all unmerged files.GCochecks out our changes for unmerged paths.GCOchecks out our changes for all unmerged paths.GCtchecks out their changes for unmerged paths.GCTchecks out their changes for all unmerged paths.
Gddisplays information about files in the index and the working tree.Gdclists cached files.Gdxlists deleted files.Gdmlists modified files.Gdulists untracked files.Gdklists killed files.Gdilists ignored files.
Gfdownloads objects and references from another repository.Gfadownloads objects and references from all remotes.Gfpprunes stale remote-tracking branches and fetches all remotes.Gfcclones a repository into a new directory.Gfmfetches from and merges with another repository or local branch.Gfrfetches from and rebases on top of another repository or local branch.Gfuprunes stale remote-tracking branches, fetches all remotes and merges.
Ggdisplays lines matching a pattern.Ggidisplays lines matching a pattern ignoring case.Ggllists files matching a pattern.GgLlists files that are not matching a pattern.Ggvdisplays lines not matching a pattern.Ggwdisplays lines matching a pattern at word boundary.
Ghdisplays help information about Git
Giaadds file contents to the index.GiAadds file contents to the index interactively.Giuadds file contents to the index (updates only known files).Giddisplays changes between the index and a named commit (diff).GiDdisplays changes between the index and a named commit (word diff).Girresets the current HEAD to the specified state.GiRresets the current index interactively.Gixremoves files from the index (recursively).GiXremoves files from the index (recursively and forced).
Gldisplays the log.Glsdisplays the stats log.Glddisplays the diff log.Glfdisplays the diff log of a given file, continuing beyond renames.Glodisplays the one line log.GlOdisplays the one line log with authors and dates.Glgdisplays the graph log.GlGdisplays the graph log with authors and dates.Glvdisplays the log, verifying the GPG signature of commits.Glcdisplays the commit count for each contributor in descending order.Glrmanages reflog information.
Gmjoins two or more development histories together.Gmaaborts the conflict resolution, and reconstructs the pre-merge state.Gmccontinues the merge after conflicts are resolved.GmCperforms a merge but does not commit.GmFcreates a merge commit even if the merge could be resolved as a fast-forward.Gmsperforms a squash merge but does not commit.GmSperforms a merge and GPG-signs the resulting commit.Gmvverifies the GPG signature of the tip commit of the side branch being merged.Gmtruns the merge conflict resolution tools to resolve conflicts.
Gpupdates remote refs along with associated objects.Gpfforces a push safely (with "lease").GpFforces a push.Gpapushes all branches.GpApushes all branches and tags.Gptpushes all tags.Gpcpushes the current branch and adds origin as an upstream reference for it.Gpppulls and pushes the current branch from origin to origin.
Grforward-ports local commits to the updated upstream head.Graaborts the rebase, and checks out the original branch.Grccontinues the rebase after merge conflicts are resolved.Grimakes a list of commits to be rebased and opens the editor.Grsskips the current patch.GrSrebases and GPG-signs the commits.
GRmanages tracked repositories.GRllists remote names and their URLs.GRaadds a new remote.GRxremoves a remote.GRmrenames a remote.GRufetches remotes updates.GRpprunes all stale remote-tracking branches.GRsshows information about a given remote.GRSchanges URLs for a remote.
Gsstashes the changes of the dirty working directory.Gsaapplies the changes recorded in a stash to the working directory.Gsxdrops a stashed state.GsXdrops all the stashed states.Gsllists stashed states.Gsddisplays changes between the stash and its original parent.Gspremoves and applies a single stashed state from the stash list.Gsrrecovers a given stashed state.Gssstashes the working directory changes, including untracked files.GsSstashes the working directory changes interactively.Gswstashes the working directory changes retaining the index.Gsistashes changes in the index retaining the working directory.Gsuunapplies (reverts) applied changes.
GSinitializes, updates, or inspects submodules.GSaadds given a repository as a submodule.GSfevaluates a shell command in each of checked out submodules.GSiinitializes submodules.GSIinitializes and clones submodules recursively.GSllists the commits of all submodules.GSmmoves a submodule.GSssynchronizes remote URL of submodules to the value specified in.gitmodules.GSufetches and merges the latest remote changes for all submodules.GSxremoves a submodule.
Gtcreates, lists, deletes or verifies a tag object signed with GPG.Gtllists tags in reverse chronological order (by commit date).Gtscreates a GPG-signed tag.Gtvverifies the GPG signature of tags.Gtxdeletes tags with given names.
Gwsdisplays the working tree status in short format.GwSdisplays the working tree status.Gwddisplays changes between the working tree and the index (diff).GwDdisplays changes between the working tree and the index (word diff).Gwrresets the current HEAD to the specified state, preserving the index and working tree.GwRresets the current HEAD, index and working tree to the specified state.Gwccleans untracked files from the working tree (dry-run).GwCcleans untracked files from the working tree.Gwmmoves or renames files.GwMmoves or renames files (forced).Gwxremoves files from the working tree and from the index (recursively).GwXremoves files from the working tree and from the index (recursively and forced).
GWmanages multiple working trees.GWacreates path with a new working tree.GWllists details of all working trees.GWmmoves a working tree to a new location.GWpprunes working tree information.GWxremoves a working tree.GWXremoves a working tree (forced).
Gyswitches branches.Gydswitches to a commit for inspection and discardable experiments.
G..changes the current directory to the top level of the working tree.G?looks up the aliases defined here with the given regular expressions.
By default, all aliases are defined with an upper case G prefix, as you can
see above. You can use the following zstyle if you wish to customize the prefix
used to generate all aliases:
zstyle ':zim:git' aliases-prefix 'g'
Add the zstyle to your ~/.zshrc before where the module is initialized.
Be careful if changing the prefix to lower case g, as the generated aliases
can shadow many commands, like gpt
for the GUID partition table maintenance utility.
git-alias-lookuplists the aliases defined here searching at the given path, by the given regular expressions.git-branch-currentdisplays the current branch.git-branch-delete-interactiveasks for confirmation to also delete the upstream remote branch(es).git-branch-remote-trackinglists all local branches with none or given remote-tracking status (gone, ahead, behind, or ahead behind).git-dirdisplays the path to the Git directory.git-ignore-addadds any arguments to the .gitignore in the project root.git-rootdisplays the path to the working tree root.git-stash-clear-interactiveasks for confirmation before clearing the stash.git-stash-recoverrecovers given dropped stashed states.git-submodule-movemoves a submodule.git-submodule-removeremoves a submodule.