* Adds additional support for PS prompt context expansion * Allow setting ZPREZTODIR to make prezto easier to integrate with * Set ZPREZTODIR to ${0:h} * Update pure prompt to v1.5.2 This fixes a security issue with malicious branch names * update brewu method Homebrew decided to not change the behaviour of `brew upgrade` so `brew upgrade --all` is equivalent to `brew upgrade` without any other arguments (so the `--all` is a no-op and can be removed). * Use python3 for http-serve alias if available (#1193) * Ensure code blocks are formatted properly for GitHub (#1271) * Add support for skipping VIRTUALENVWRAPPER init in modules/python (#598) * Support skip-virtualenvwrapper-init zstyle in python module to avoid auto-sourcing of virtualenvwrapper.sh * Don't overwrite the WORKON_HOME env var if the user has already set it * Don't load pfunctions from vi swap files * Change $TMPDIR for non-interactive shells This commit changes the way $TMPDIR is set by using `mktemp` rather than a fixed string. * Add "sa" alias to make it easy to search aliases * Avoid unsetting nonexistent variables (#1075) * Add nodenv support to Node.js module - Implementation from https://github.com/sorin-ionescu/prezto/pull/1001 - Documentation from https://github.com/sorin-ionescu/prezto/pull/1178 * Prefer $(COMMAND) syntax over backticks (#1012) * Remove extra use of grep in git-hub-shorten-url (#904) * Add notice about potential shadowing of the gb command (#1124) * Use less destructive git push --force-with-lease. * Improve and simplify titling functions. Multiplexer titles can be set independent of window and tab titles. Add auto-title always option to have dynamic titling inside terminal multiplexers. Setting auto-title to yes continues to ignore dynamic titling inside terminal multiplexers. This patch should not alter behavior under Apple terminals. * Update zsh-autosuggestions submodule location Thanks to @naibaf0. Closes #1096. * Update zsh-users submodules to latest stable versions * Update external prompt modules * Added option to skip git aliases definition Fixes #947 * Added support for python venv display in paradox prompt * utility module: fix/improve colordiff call in diff The new call is compatible with colordiff v1.0.8 - v.1.0.15 (might be compatible with even earlier versions, but not tested), while the original one breaks down under v1.0.14 and v1.0.15. See https://github.com/daveewart/colordiff/issues/22. * Bump license years and tidy up readme (#1273) * Add support for iTerm2 v3 in tab function * Use patterns from ruby module for initializing nodenv * Fix path in node module * FIXED: syntax error in osx module tab function * Only try to run python-info if it exists for the paradox prompt * Move common promptpwd code to external function * Ensure extendedglob is set in promptpwd * Remove manb from completion filename * Update fasd README with basic installation information * Feat (aliases): add aliases for git flow * Allow syntax highlighting pattern styles (#1192) * completion: Cap max-errors at 7 to avoid hanging (#953) 7 is pretty arbitrarily chosen, but seems like a reasonable tradeoff, at least the completion no longer shows symptoms of exponential time-growth when trying to complete something completely wrong. This fixes #946. * Add note about working around preexisting runcoms Closes #955 * Don't use a deprecated argument as a python example Thanks to @jeffwidman for pointing this out Closes #1141 * Add bundle clean alias * Doc (ruby): add doc on bundle clean alias * Feat (docker): add docker aliases (#1147) Thanks to @malikoth and @saoula for their input. * Fix indentation in README * Update is-callable to also check builtins Fixes #1037 * Add code style to CONTRIBUTING.md Closes #1296 * Add note to CONTRIBUTING.md about zstyle * Add initial issue and pull request templates * Remove additional newlines in issue and pull request templates * Rework diff function This removes --unified from the default options to make it possible to pass -y without worrying about conflicting output formats. diffu has also been added as an alias to make it easier to get output as a unified diff. Fixes #1231 * Add missing alias to utility README * Move python-info call in paradox from preexec to precmd * archive: add support for *.jar files (#1302) * archive: add archive function * Add perl-info function & plenv subcommand aliases (#1303) * Add perl-info function * Add alias for plenv subcommands * Load perlbrew if needed * Load plenv if needed * Use PERLBREW_ROOT as priority to detect Perlbrew * Add utility alias for pydf * New `alias gfa=git fetch --all` for git module Also includes an updated README.md ! * Update ssh module for multi session hosts create ssh_agent_env with current user id in file name to avoid collisions with other users create ssh_agent_sock with current user id in file name to avoid collisions with other users * Add support for 'pip', 'pip2', 'pip3' completion Since `pip completion --zsh` might be slow, we cache it beforehand. The implementation is along the lines of 'npm' completion in 'node' module. * rsync: Update reference to Bombich's rsync page Seems like Bombich's rsync page moved with the previous link doing 404. Adjusted to fix this. * Add zstyle option to show pwd in long format * Convert long-pwd to pwd-length * Add better support for pyenv virtualenvs * Add some new git aliases, modify a few more. (#1301) * Add some new git aliases, modify a few more. * Add `gbV` command to show more verbose git branch info. * Add `gcam` to make it possible to execute `gca; gcm '<your message here>'` more simply. * Add `gii` command to temporarily untrack (ignore) a file. * Add `giI` command to uningore a file. * Change alias of `gbl` to `gbv`. Personally, I think aliases that include a switch in the command should include the switch in the alias if possible. This makes them easier to remember. * Change alias of `gbL` to `gba`. I think the `-a` switch is more salient to what this alias does than the `-v`. Furthermore, with this PR there are already `gbv` and `gbV` aliases, so those are out. * Change implementation of `gCl` alias to use built-in capabilities of git, rather than sed. * Rename gbx and gbX to gbd and gbD respectively * Mostly revert alias changes * Add gbr and gbR aliases to gbm and gbM commands * Add gbr and gbR aliases to module readme * Use the lazy-loaded version of virtualenvwrapper if available This shouldn't cause problems for anyone and should improve startup times for anyone using python with virtualenvwrapper because it will wait for the first command to load rather than right away. * broken $path and $PATH if nodenv exists (#1315) This change fixes a bug where no command can be found (e.g. `ls`) due to the $path array being set to two elements, one of them with all the previous paths separated by spaces. This makes zsh break $PATH, instead of colons there are spaces, and nothing works. The idea is to have the array be set leveraging the word splitting that we usually are told to avoid by quoting. * Cache the completion for a quicker startup The original idea was by @samjonester in #1210. This version aims to avoid relying on the stat or date programs because they have different flags depending on the OS and if it uses BSD or GNU coreutils. * Add the ability to specify tmux session name * Change the zstyle config name for #607 * Allow ssh module to run on OSX * Python virtualenv auto workon cwd hook (#1300) * Command to activate virtualenvs on changing directory Enables automatic activation of a virtualenv when jumping into a directory This is done by looking in the current directory for a file or directory named `.venv`. If it's not found in the current directory its parents will also be examined. `.venv` can be either: 1. A file containing the name of a virtualenv found in $WORKON_HOME 2. A directory containing bin/activate (meaning that the directory is assumed to be a virtualenv.) If $WORKON_HOME is set it is assumed that virtualenvwrapper is installed and the `workon` command will be issued. * Update python docs to include info on virtualenv auto-switching * replace the deprecated abs call in the pacu alias. * zprofile: Use non-random static TMPDIR Closes #1319 * sorin theme: Use a proper temp file for async data * Default sorin theme to /tmp when TMPDIR is not set Fixes #1331 * Add git aliases for signing commits (#1126) * Change print to printf in init.zsh error (#1335) When my zsh had issues, and I was debugging it, this line would end up being run but no output would be made to the screen. Changing it from print to printf caused the error to properly be displayed. * fixed vivisual key binding (#1148) Fixes #1236 * Move virtualenv auto-switch cwd hook optional loader out from inside unrelated if statement (#1338) * Fix #1337 by removing top alias to htop. (#1341) Fixes #1337 * [completion] Bump external repository to version 0.25.0 8cdf60b Updated rkt commands and arguments f9d7d9d Implemented autocompletion for rkt pods and images (Fixes #465) 9feab39 Added completion for yarn a63a098 Update completion for mix, add completion for mix test, fix completion for mix help 6285e0e Add completions for bitcoin-cli 0ed2e86 Set proper description for gist -r df5a3a1 Try to follow the style guide d7a2972 Add gist completion for read flag b0cb2ad Added _rclone b7c11f4 drop ripgrep completion 907cba3 Update repository infos ccb53f4 Support newer versions of OpenSSL f02dc8f add licence information ceaff68 Add completion for ffind * [autosuggestions] Bump external repository to version v0.4.0 14179d8 Bump version 281ed9b v0.4.0 changelog updates 83129dd Make asynchronous suggestions disabled by default a2f0ffb Enabling suggestions should not fetch a suggestion if buffer is empty 7d4a1d9 Add enable/disable/toggle widgets to disable suggestion functionality e1959d0 Put in a general fix for #219 - Handling input from `zle -U` c52c428 Fix issues with widgets wrapped by other plugins ea505b0 Add a spec for unlisted widgets fetching a new suggestion 502fb4a Make tmux_socket_name public so you can access easily from binding.pry ce36224 Use pry-byebug instead of pry for more functionality 39762ec Set up circle ci 468b740 Test should be passing block to RSpec wait_for c9a51e0 Handle dashes at the beginning of commands 48a21bf [cleanup] Remove an extra newline 4afbbba We only need to run the feature detection if starting async e3fa4e4 Don't do anything but re-bind widgets on each precmd 2cd99e6 Add a test for modifying widget list vars after sourcing plugin c70d685 Clean up widget list spec 255359d Use `+=` to be a bit more true to the spec language 4321fc0 We need to bind on every precmd to ensure we wrap other wrappers 75e8505 Gracefully handle being sourced multiple times a0fcd81 Destroy zpty on load if it already exists 39ca3da Use a different name for feature detection zpty dcce973 Remove support for long-deprecated options 0c940e7 Don't bind any zle-* methods 23ef16c Do not show suggestions if the buffer is empty 9381445 Fix tests c4bfd8e Need to prevent zpty feature detection from HUPing existing zptys c959408 Only wait a max of 2 seconds for content to match after clearing screen 06fca77 Readme updates for v0.4.0 9feac57 Do not show any error output from async zpty server process ed8056c Lots of async changes 38eb7cd Update license date 64e7ec5 Rename internal term session method 98f926d Clean up TerminalSession constructor a bit 51e8755 TerminalSession methods return self to support chaining 5151adf Make TerminalSession#clear block until the screen is cleared 2c465a9 Rename async pty name config var e3eb286 Lots of little async cleanups c342587 Wait for the terminal.clear to go through before continuing 89dd69d Add pry gem for debugging support 40bb2e7 little cleanup 16666da Handle versions of zsh where zpty does not set REPLY to fd of opened pty f33b605 Move async initialization into `start` function to keep in one place 78ba071 Add feature detection 3f57198 Only bind widgets once, on initial sourcing 2dbd261 Allow configuring of zsh binary to run integration tests against 6c5cd42 Go back to tracking last pid because `kill %1` didn't seem to be working 54e1eee Optimize case where manually typing in a suggestion 21d9eda Wrap suggestion fetch command in parens to actually run in background 50e6832 Escape the prefix passed into the match_prev_cmd strategy 0305908 Revert `fc` usage in calculating suggestion 8e06a54 Add test for string with "\n" in it b3208b0 Pass the chosen strategy into the suggestion server pty ab27425 Quote the suggestion to support sh_split_word option e5a5b0c Output only newlines in the pty 0337005 Disable word splitting while reading to preserve whitespace b530b0c Use `zpty -r` with pattern matching to fetch suggestion 5c891af Reset zsh options inside pty (from zsh-async) e33eb57 Send only the prefix to the suggestion server fba20b0 Use %1 instead of tracking pid 0308ed7 Rename worker to server e72c2d8 add a bunch of comments ab8f295 First pass at async functionality debbffc Add rspec test around accepting suggestions 4850119 Add separate test task for RSpec c22ab0e Implement suggestion integration tests in RSpec + tmux 07a6768 Add TerminalSession helper for managing a tmux session e6591d5 Add RSpec for high-level integration testing af671fb Add ruby settings to editor config * [syntax-highlighting] Bump external repository to get bug fixes ad522a0 driver: Fix printing error message to file when cannot resolve highlighters directory location 73cb832 'main': Highlight mismatched 'if'/'fi'. be083d7 driver: Improve «unhandled ZLE widget 'foo'» error message. 237f89a 'main': Don't consider «$*» a glob. 835fec7 workaround for PAT_STATIC bug in zsh 9523d6d tests: zsh 5.4-to-be compatibility: Set a new "I am shooting myself in the foot" option. aac4a44 driver: Fix duplicated slash in error message 4f49c4a docs: Update zplug install instruction 5efd062 tests: Add a regression test for issue #392 (aliases beginning with a '+' are lost). 67be621 tests: Move some code in preparation for next commit. No functional change. 74949c2 driver: Don't undefine aliases that begin with a '+', to workaround an upstream bug. 8d5afe4 driver: Be immune to 'alias' having been redefined. 76ea9e1 'main': Highlight possible history expansions in double-quoted strings. 50fbb5f docs: Update Homebrew link. 2dce602 driver: Be immune to weird aliases in the calling scope. 347cf0e 'main': Add regression test for previous commit. 5625e30 'main': Fix bug: no start_pos=$end_pos in comment short path fed37a9 'main': Fix a bug concerning command word with embedded colon-space sequences. 626c034 Add FreeBSD port 3d74aa4 Add Fedora package 5398949 changelog: Update for changes pulled out of 0.5.x. * [editor] Set Delete key in vicmd mode to delete character Delete key deletes character in vimcmd cmd mode instead of weird default functionality. The default functionality in vicmd mode is the Delete key will change the case of many of the characters on the screen, which is not the default thing that vim does. This could be confusing and frustrating to users, so set it to delete a character instead. * Remove redundant style rules from CONTRIBUTING.md * [runcoms/zprofile+zshenv] Ensure TMPDIR is always set In some cases TMPDIR may not be set, in which case it could cause issues for zsh modules. This change was prompted by issue #1331. Also when creating a missing TMPDIR, use mkdir --mode=700 instead of creating the directory and then chmoding it afterward. * [CONTRUBITING] Add section on using a secondary devel directory Add a section on how to use a separate directory than your normal ZDOTDIR for development with its own zprezto. * [zprezto-update] Add convenience function to update zprezto (#1344) * [zprezto-update] Add convenience function to update zprezto This function checks if there is any update to zprezto, and if so will pull in the changes. It will not attempt a pull unless it is fastforwardable. It also makes sure the user is on the master branch before attempting. * [zprezto-update] Improve resilience of the function Better error checking of status of the git repository and better error producing. Fit columns into mostly 80 width and add a missing printf argument. Use ( ) around the function so changing directory does not affect the outer scope. * [README] Add instructions on using zprezto-update function * Fixed ssh-add not using SSH_ASKPASS * [editor] set forward/backward word for Ctrl+Right Ctrl+Left Set forward/backward word to be mapped the same as they are in vim, instead of having weird functionality when unset. * [utility] scp/rsync glob local paths but don't glob remote paths Adds a function which wraps rsync and scp so that remote paths are not globbed but local paths are globbed. This is because the programs have their own globbing for remote paths. The wrap function globs args starting in / and ./ and doesn't glob paths with : in it as these are interpreted as remote paths by these programs unless the path starts with / or ./ Fixes issue #1125 * Fix README example on tmux's default session name * Updater: fix bug regarding source init in new updater logic * [prompt/sorin] Fix branch code exploit vulnerability Escape all $ except the first $. Escape all backtick `'s. This prevents variable names or shell expansions placed as branch names from remotely exploiting code. Fixes issue #1267 for sorin prompt. * [editor] Add bindkey-all function to show all bound keys (#1358) * [editor] Add bindkey-all function to show all bound keys Function which allows you to see all the bound keys for all of the different keymaps. It does accept arguments and passes them through to bindkey -m "$keymap" so you could set a shortcut to all keymaps as well if you wished. Makes it much easier to see and grep what keys are bound to each of the different keymaps. When no arguments are given it will print keymap headers to stderr, if given arguments it will not print anything extra to the screen. * [editor] Update README to include information about bindkey-all funct. * Ensure we use the same function definition syntax everywhere * Add comments into each of the function files to make them easier to find * [git] Fix 'git-hub-shorten-url' helper Changes: - Use git.io over 'https' - Add extra check to conform to *.github.com URLs - Use built-in _urls function for completion - Update readme with GitHub blog URL * gpg: fix enable-ssh-support detection That line may be commented in the config file. * [editor] Fix undefined results with unbound keys in viins/vicmd Bind the remaining unbound keys in the main mode so that they don't result in undefined functionality when pressed. (Often this will change the casing of one/most/all of the characters you've typed or even stranger things). In emacs mode this usually just inserts a tilde, but this will fix that as well so nothing happens when unbound keys are pressed. Since there isn't any binding which does "nothing", create a noop ZLE widget and bind them to that. The user or other modules are still able to override these bindings either by overriding the main keymap or setting a keymap in one of the other modes which will take precedence over the main fallback. * Prefer evaluation over test for arithmetic expression Usage of `(( ... ))` over `[[ ... ]]` is preferred for arithmetic expression since the former is less error prone. Also, unset local variable whenever possible. * python: add ubuntu locations for virtualenvwrapper.sh * [editor] Ensure unbound_keys is defined as an array Somewhere around zsh 5.1, there was a change which turned typeset (and most likely local) into a keyword. In older versions of zsh, using `local x=()` will cause the () to be treated as a glob qualifier. Fixes #1373 * [completion] Minor cleanup of zstyle completion 'tag-order' De-duplicate common zstyle 'tag-order' for ssh, scp and rsync. * [utility] Add safe-ops zstyle option to disable safe rm/cp/ln/mv Currently rm/cp/ln/mv are aliased to rm/cp/ln/mv -i so that it will prompt before removing files. Some people would not like this functionality and wish for an easy way to disable it. This adds a new option: zstyle ':prezto:module:utility' safe-ops yes/no It is enabled by default even if zstyle is not set, but can be set to no to disable these aliases. This should resolve issue #205 * [utility] Move the safeops aliases into their own section and add XXi variants * Update documentation on safeops * Add a .editorconfig file to setup tabstyle preferences With editors that support it it will setup preferences so that it will use 2 spaces as the indent, except in .gitignore and .gitmodules which in our files use tabs. For more info see http://EditorConfig.org * Small editorconfig file cleanup * add alias for cloning a repo including all submodules * change alias to gfcr * Detach from tmux if attached, before attach (#1088) If you are in a tmux session, and auto-start is enabled Then you `sudo su` and then `su <username>` it will re-attach, in a loop. This resolves that problem, by forcing a detach before a (re)attach. * git: Add revert to special action contexts revert is very similar to cherry-pick and has a sequence variant. * Add fasd as an external module * fasd: fall back to submodule only if command is missing * [command-not-found] Load brew 'command-not-found' if homebrew tap is available Homebrew has _official_ tap that supports `command-not-found`. Enable it when possible. * Cleanup spurious whitespace * utility: fix completion for rsync and scp * [utility] Remove premature call to `compdef` This is a temporary fix to work-around a minor regression in |
||
---|---|---|
.. | ||
functions | ||
alias.zsh | ||
init.zsh | ||
README.md |
Git
Enhances the Git distributed version control system by providing aliases, functions and by exposing repository status information to prompts.
Git 1.7.2 is the minimum required version.
Settings
Log
The format of the git-log output is configurable via the following style,
where context is brief, oneline, and medium, which will be passed to the
--pretty=format:
switch.
zstyle ':prezto:module:git:log:context' format ''
Status
Retrieving the status of a repository with submodules can take a long time. Submodules may be ignored when they are dirty, untracked, all, or none.
zstyle ':prezto:module:git:status:ignore' submodules 'all'
This setting affects all aliases and functions that call git-status
.
Aliases
Aliases are enabled by default. You can disable them with:
zstyle ':prezto:module:git:alias' skip 'yes'
Git
g
is short forgit
.
Branch
gb
lists, creates, renames, and deletes branches.gbc
creates a new branch.gbl
lists branches and their commits. (alsogbv
)gbL
lists all local and remote branches and their commits.gbr
renames a branch. (alsogbm
)gbR
renames a branch even if the new branch name already exists. (alsogbM
)gbs
lists branches and their commits with ancestry graphs.gbS
lists local and remote branches and their commits with ancestry graphs.gbV
lists branches with more verbose information about their commits.gbx
deletes a branch. (alsogbd
)gbX
deletes a branch irrespective of its merged status. (alsogbD
)
Commit
gc
records changes to the repository.gca
stages all modified and deleted files.gcm
records changes to the repository with the given message.gcS
records changes to the repository. (Signed)gcSa
stages all modified and deleted files. (Signed)gcSm
records changes to the repository with the given message. (Signed) -gco
checks out a branch or paths to work tree.gcam
stages all modified and deleted files, and records changes to the repository with the given message.gco
checks out a branch or paths to work tree.gcO
checks out hunks from the index or the tree interactively.gcf
amends the tip of the current branch using the same log message as HEAD.gcSf
amends the tip of the current branch using the same log message as HEAD. (Signed)gcF
amends the tip of the current branch.gcSF
amends the tip of the current branch. (Signed)gcp
applies changes introduced by existing commits.gcP
applies changes introduced by existing commits without committing.gcr
reverts existing commits by reverting patches and recording new commits.gcR
removes the HEAD commit.gcs
displays various types of objects.gcl
lists lost commits.
Conflict
gCl
lists unmerged files.gCa
adds unmerged file contents to the index.gCe
executes merge-tool on all unmerged file.gCo
checks out our changes for unmerged paths.gCO
checks out our changes for all unmerged paths.gCt
checks out their changes for unmerged paths.gCT
checks out their changes for all unmerged paths.
Data
gd
displays information about files in the index and the work tree.gdc
lists cached files.gdx
lists deleted files.gdm
lists modified files.gdu
lists untracked files.gdk
lists killed files.gdi
lists ignored files.
Fetch
gf
downloads objects and references from another repository.gfa
downloads objects and references from all remote repositories.gfc
clones a repository into a new directory.gfcr
clones a repository into a new directory including all submodules.gfm
fetches from and merges with another repository or local branch.gfr
fetches from and rebases on another repository or local branch.
Flow
gFi
is short forgit flow init
Feature
gFf
is short forgit flow feature
gFfl
is short forgit flow feature list
gFfs
is short forgit flow feature start
gFff
is short forgit flow feature finish
gFfp
is short forgit flow feature publish
gFft
is short forgit flow feature track
gFfd
is short forgit flow feature diff
gFfr
is short forgit flow feature rebase
gFfc
is short forgit flow feature checkout
gFfm
is short forgit flow feature pull
gFfx
is short forgit flow feature delete
Bugfix
gFb
is short forgit flow bugfix
gFbl
is short forgit flow bugfix list
gFbs
is short forgit flow bugfix start
gFbf
is short forgit flow bugfix finish
gFbp
is short forgit flow bugfix publish
gFbt
is short forgit flow bugfix track
gFbd
is short forgit flow bugfix diff
gFbr
is short forgit flow bugfix rebase
gFbc
is short forgit flow bugfix checkout
gFbm
is short forgit flow bugfix pull
gFbx
is short forgit flow bugfix delete
Release
gFl
is short forgit flow release
gFll
is short forgit flow release list
gFls
is short forgit flow release start
gFlf
is short forgit flow release finish
gFlp
is short forgit flow release publish
gFlt
is short forgit flow release track
gFld
is short forgit flow release diff
gFlr
is short forgit flow release rebase
gFlc
is short forgit flow release checkout
gFlm
is short forgit flow release pull
gFlx
is short forgit flow release delete
Hotfix
gFh
is short forgit flow hotfix
gFhl
is short forgit flow hotfix list
gFhs
is short forgit flow hotfix start
gFhf
is short forgit flow hotfix finish
gFhp
is short forgit flow hotfix publish
gFht
is short forgit flow hotfix track
gFhd
is short forgit flow hotfix diff
gFhr
is short forgit flow hotfix rebase
gFhc
is short forgit flow hotfix checkout
gFhm
is short forgit flow hotfix pull
gFhx
is short forgit flow hotfix delete
Support
gFs
is short forgit flow support
gFsl
is short forgit flow support list
gFss
is short forgit flow support start
gFsf
is short forgit flow support finish
gFsp
is short forgit flow support publish
gFst
is short forgit flow support track
gFsd
is short forgit flow support diff
gFsr
is short forgit flow support rebase
gFsc
is short forgit flow support checkout
gFsm
is short forgit flow support pull
gFsx
is short forgit flow support delete
Grep
gg
displays lines matching a pattern.ggi
displays lines matching a pattern ignoring case.ggl
lists files matching a pattern.ggL
lists files that are not matching a pattern.ggv
displays lines not matching a pattern.ggw
displays lines matching a pattern at word boundary.
Index
gia
adds file contents to the index.giA
adds file contents to the index interactively.giu
adds file contents to the index (updates only known files).gid
displays changes between the index and a named commit (diff).giD
displays changes between the index and a named commit (word diff).gii
temporarily ignore differences in a given file.giI
unignore differences in a given file.gir
resets the current HEAD to the specified state.giR
resets the current index interactively.gix
removes files/directories from the index (recursively).giX
removes files/directories from the index (recursively and forced).
Log
gl
displays the log.gls
displays the stats log.gld
displays the diff log.glo
displays the one line log.glg
displays the graph log.glb
displays the brief commit log.glc
displays the commit count for each contributor in descending order.
Merge
gm
joins two or more development histories together.gmC
joins two or more development histories together but does not commit.gmF
joins two or more development histories together but does not commit generating a merge commit even if the merge resolved as a fast-forward.gma
aborts the conflict resolution, and reconstructs the pre-merge state.gmt
runs the merge conflict resolution tools to resolve conflicts.
Push
gp
updates remote refs along with associated objects.gpf
forcefully updates remote refs along with associated objects.gpa
updates remote branches along with associated objects.gpA
updates remote branches and tags along with associated objects.gpt
updates remote tags along with associated objects.gpc
updates remote refs along with associated objects and adds origin as an upstream reference for the current branch.gpp
pulls and pushes from origin to origin.
Rebase
gr
forward-ports local commits to the updated upstream head.gra
aborts the rebase.grc
continues the rebase after merge conflicts are resolved.gri
makes a list of commits to be rebased and opens the editor.grs
skips the current patch.
Remote
gR
manages tracked repositories.gRl
lists remote names and their URLs.gRa
adds a new remote.gRx
removes a remote.gRm
renames a remote.gRu
fetches remotes updates.gRp
prunes all stale remote tracking branches.gRs
displays information about a given remote.gRb
opens a remote on GitHub in the default browser.
Stash
gs
stashes the changes of the dirty working directory.gsa
applies the changes recorded in a stash to the working directory.gsx
drops a stashed state.gsX
drops all the stashed states.gsl
lists stashed states.gsL
lists dropped stashed states.gsd
displays changes between the stash and its original parent.gsp
removes and applies a single stashed state from the stash list.gsr
recovers a given stashed state.gss
stashes the changes of the dirty working directory, including untracked.gsS
stashes the changes of the dirty working directory interactively.gsw
stashes the changes of the dirty working directory retaining the index.
Submodule
gS
initializes, updates, or inspects submodules.gSa
adds given a repository as a submodule.gSf
evaluates a shell command in each of checked out submodules.gSi
initializes submodules.gSI
initializes and clones submodules recursively.gSl
lists the commits of all submodules.gSm
moves a submodule.gSs
synchronizes submodules' remote URL to the value specified in .gitmodules.gSu
fetches and merges the latest changes for all submodule.gSx
removes a submodule.
Working directory
gws
displays working-tree status in the short format.gwS
displays working-tree status.gwd
displays changes between the working tree and the index (diff).gwD
displays changes between the working tree and the index (word diff).gwr
resets the current HEAD to the specified state, does not touch the index nor the working tree.gwR
resets the current HEAD, index and working tree to the specified state.gwc
removes untracked files from the working tree (dry-run).gwC
removes untracked files from the working tree.gwx
removes files from the working tree and from the index recursively.gwX
removes files from the working tree and from the index recursively and forcefully.
Shadows
The following aliases may shadow system commands:
gpt
shadows the GUID partition table maintenance utility.gs
shadows the Ghostscript.gb
shadows the GB.
If you frequently use the above commands, you may wish to remove said aliases
from this module or to disable them at the bottom of the zshrc with unalias
.
You can temporarily bypass an alias by prefixing it with a backward slash:
\gpt
.
Functions
git-branch-current
displays the current branch.git-commit-lost
lists lost commits.git-dir
displays the path to the Git directory.git-hub-browse
opens the GitHub repository in the default browser.git-hub-shorten-url
shortens GitHub URLs.git-info
exposes repository information via the$git_info
associative array.git-root
displays the path to the working tree root.git-stash-clear-interactive
asks for confirmation before clearing the stash.git-stash-dropped
lists dropped stashed states.git-stash-recover
recovers given dropped stashed states.git-submodule-move
moves a submodule.git-submodule-remove
removes a submodule.
Theming
To display information about the current repository in a prompt, define the
following styles in the prompt_name_setup
function, where the syntax for
setting a style is as follows.
zstyle ':prezto:module:git:info:context:subcontext' format 'string'
Main Contexts
Name | Format Code | Description |
---|---|---|
action | %s | Special action name |
ahead | %A | Commits ahead of remote count |
behind | %B | Commits behind of remote count |
branch | %b | Branch name |
commit | %c | Commit hash |
position | %p | Commits from the nearest tag count |
remote | %R | Remote name |
stashed | %S | Stashed states count |
Concise Contexts
Name | Format Code | Description |
---|---|---|
clean | %C | Clean state |
dirty | %D | Dirty files count |
indexed | %i | Indexed files count |
unindexed | %I | Unindexed files count |
untracked | %u | Untracked files count |
The following contexts must be enabled with the following zstyle:
zstyle ':prezto:module:git:info' verbose 'yes'
Verbose Contexts
Name | Format Code | Description |
---|---|---|
added | %a | Added files count |
clean | %C | Clean state |
deleted | %d | Deleted files count |
dirty | %D | Dirty files count |
modified | %m | Modified files count |
renamed | %r | Renamed files count |
unmerged | %U | Unmerged files count |
untracked | %u | Untracked files count |
Special Action Contexts
Name | Format | Description |
---|---|---|
apply | value | Applying patches |
bisect | value | Binary searching for changes |
cherry-pick | value | Cherry picking |
cherry-pick-sequence | value | Cherry picking sequence |
merge | value | Merging |
rebase | value | Rebasing |
rebase-interactive | value | Rebasing interactively |
rebase-merge | value | Rebasing merge |
revert | value | Reverting |
revert-sequence | value | Reverting sequence |
First, format the repository state attributes. For example, to format the branch and remote names, define the following styles.
zstyle ':prezto:module:git:info:branch' format 'branch:%b'
zstyle ':prezto:module:git:info:remote' format 'remote:%R'
Second, format how the above attributes are displayed in prompts.
zstyle ':prezto:module:git:info:keys' format \
'prompt' ' git(%b)' \
'rprompt' '[%R]'
Last, add $git_info[prompt]
to $PROMPT
and $git_info[rprompt]
to
$RPROMPT
respectively and call git-info
in the prompt_name_preexec
hook
function.
Authors
The authors of this module should be contacted via the issue tracker.