Everything you need for customizing your git prompt in oh-my-zsh
print
andecho
commands for all functions in thegit
plugin. Printing and echoing because then i can check what values are outputted. Massively helpful when creating a theme.- a list of all the variables that you can use to customize
$(git_prompt_info)
, thanks to vergenzt
grep -o "ZSH_THEME_GIT_[A-Z_]\+" lib/git.zsh| sort | uniq
$(git_prompt_info) # Outputs current branch info in prompt format
$(parse_git_dirty) # Checks if working tree is dirty
$(git_remote_status) # Gets the difference between the local and remote branches
$(git_current_branch) # Outputs the name of the current branch
$(git_commits_ahead) # Gets the number of commits ahead from remote
$(git_commits_behind) # Gets the number of commits behind remote
$(git_prompt_ahead) # Outputs if current branch is ahead of remote
$(git_prompt_behind) # Outputs if current branch is behind remote
$(git_prompt_remote) # Outputs if current branch exists on remote or not
$(git_prompt_short_sha) # Formats prompt string for current git commit short SHA
$(git_prompt_long_sha) # Formats prompt string for current git commit long SHA
$(git_prompt_status) # Get the status of the working tree
$(git_current_user_name) # Outputs the name of the current user
$(git_current_user_email) # Outputs the email of the current user
$(git_repo_name) # Output the name of the root directory of the git repository