{"id":22064340,"url":"https://github.com/zimfw/git-info","last_synced_at":"2025-04-13T12:13:08.081Z","repository":{"id":46229110,"uuid":"113081229","full_name":"zimfw/git-info","owner":"zimfw","description":"Exposes git repository status information to prompts.","archived":false,"fork":false,"pushed_at":"2025-02-11T14:45:28.000Z","size":61,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T12:13:03.243Z","etag":null,"topics":["git","zim","zimfw","zsh","zsh-plugin","zsh-plugins"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zimfw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-12-04T18:47:24.000Z","updated_at":"2025-02-11T14:45:32.000Z","dependencies_parsed_at":"2025-01-29T21:35:28.605Z","dependency_job_id":null,"html_url":"https://github.com/zimfw/git-info","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/zimfw%2Fgit-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fgit-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fgit-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fgit-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimfw","download_url":"https://codeload.github.com/zimfw/git-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710447,"owners_count":21149191,"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","zim","zimfw","zsh","zsh-plugin","zsh-plugins"],"created_at":"2024-11-30T19:04:08.999Z","updated_at":"2025-04-13T12:13:08.064Z","avatar_url":"https://github.com/zimfw.png","language":"Shell","readme":"git-info\n========\n\nExposes git repository status information to prompts.\n\nMany thanks to [Sorin Ionescu] and [Colin Hebert] for the original code.\n\nSettings\n--------\n\n### Ignore submodules\n\nRetrieving the status of a repository with submodules can take a long time.\nSo by default 'all' submodules are ignored. Optionally, 'untracked', 'dirty', or\n'none' submodules can be ignored:\n\n    zstyle ':zim:git-info' ignore-submodules 'none'\n\n### Verbose mode\n\nVerbose mode uses `git status` and computes the count of indexed, unindexed and\nalso untracked files. Verbose mode can be slower, depending on your repository\nand the git version being used. It can be enabled with the following zstyle:\n\n    zstyle ':zim:git-info' verbose yes\n\nIn non-verbose mode, the untracked context is not available (see *Main contexts*\nbelow), and untracked files are also not considered for computing the dirty\ncontext.\n\nTheming\n-------\n\nTo display information about the current repository in a prompt, use the\nfollowing syntax to define custom styles for each context you want displayed:\n\n    zstyle ':zim:git-info:\u003ccontext_name\u003e' format '\u003cstring\u003e'\n\n### Main contexts\n\n| Name      | Code | Description\n| --------- | :--: | -----------------------------------------------------------\n| action    |  %s  | Special action name (see *Special action contexts* below)\n| ahead     |  %A  | Commits ahead of remote count\n| behind    |  %B  | Commits behind remote count\n| diverged  |  %V  | Diverged commits (both ahead and behind are yield when it's not defined)\n| branch    |  %b  | Branch name\n| commit    |  %c  | Commit short hash (when in 'detached HEAD' state)\n| clean     |  %C  | Clean state\n| dirty     |  %D  | Dirty state (count with untracked files when verbose mode enabled)\n| indexed   |  %i  | Indexed files (count when verbose mode enabled)\n| unindexed |  %I  | Unindexed files (count when verbose mode enabled)\n| position  |  %p  | Name of tag that contains current commit (when in 'detached HEAD' state)\n| remote    |  %R  | Remote name\n| stashed   |  %S  | Stashed states count\n| untracked |  %u  | Untracked files count (only when verbose mode enabled)\n\nWhile the commit and position contexts are only available when in ['detached\nHEAD' state], on the other hand, the ahead, behind, diverged, branch and remote\ncontexts are only available when an actual branch is checked out (so when\n**not** in 'detached HEAD' state).\n\n### Special action contexts\n\n| Name              | Description             | Default value\n| ----------------- | ----------------------- | -------------\n| action:rebase-i   | Rebase interactive      | rebase-i\n| action:rebase-m   | Rebase merge            | rebase-m\n| action:rebase     | Rebase                  | rebase\n| action:am         | Apply mailbox           | am\n| action:am/rebase  | Apply mailbox or rebase | am/rebase\n| action:merge      | Merge                   | merge\n| action:revert-seq | Revert sequence         | revert-seq\n| action:revert     | Revert                  | revert\n| action:cherry-seq | Cherry-pick sequence    | cherry-seq\n| action:cherry     | Cherry-pick             | cherry\n| action:bisect     | Bisect                  | bisect\n\nFormatting example for special actions:\n\n    zstyle ':zim:git-info:action:bisect' format '\u003cB\u003e'\n    zstyle ':zim:git-info:action:merge'  format '\u003eM\u003c'\n    zstyle ':zim:git-info:action:rebase' format '\u003eR\u003e'\n\n### Usage\n\nFirst, customize the contexts you want displayed. For example, to format the\nbranch name, commit, and remote name, define the following styles:\n\n    zstyle ':zim:git-info:branch' format 'branch:%b'\n    zstyle ':zim:git-info:commit' format 'commit:%c'\n    zstyle ':zim:git-info:remote' format 'remote:%R'\n\nSecond, define where the above contexts are displayed in prompts:\n\n    zstyle ':zim:git-info:keys' format \\\n        'prompt'  'git(%b%c)' \\\n        'rprompt' '[%R]'\n\nLast, add `${(e)git_info[prompt]}` and `${(e)git_info[rprompt]}` to `PS1` and\n`RPS1` respectively, and add `git-info` to the precmd hooks.\n\nHere's a complete example:\n```zsh\nsetopt nopromptbang prompt{cr,percent,sp,subst}\n\nzstyle ':zim:git-info:branch' format 'branch:%b'\nzstyle ':zim:git-info:commit' format 'commit:%c'\nzstyle ':zim:git-info:remote' format 'remote:%R'\n\nzstyle ':zim:git-info:keys' format \\\n    'prompt'  'git(%b%c)' \\\n    'rprompt' '[%R]'\n\nautoload -Uz add-zsh-hook \u0026\u0026 add-zsh-hook precmd git-info\n\nPS1='${(e)git_info[prompt]}%# '\nRPS1='${(e)git_info[rprompt]}'\n```\n\n[Sorin Ionescu]: https://github.com/sorin-ionescu\n[Colin Hebert]: https://github.com/ColinHebert\n['detached HEAD' state]: https://git-scm.com/docs/git-checkout#_detached_head\n","funding_links":[],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fgit-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimfw%2Fgit-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fgit-info/lists"}