{"id":15873747,"url":"https://github.com/tomastomecek/pretty-git-prompt","last_synced_at":"2025-03-16T04:30:43.855Z","repository":{"id":17734145,"uuid":"82606055","full_name":"TomasTomecek/pretty-git-prompt","owner":"TomasTomecek","description":"`git status` inside your shell prompt","archived":false,"fork":false,"pushed_at":"2024-02-21T09:24:52.000Z","size":1147,"stargazers_count":51,"open_issues_count":14,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-15T23:24:37.383Z","etag":null,"topics":["git","prompt","zsh"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/TomasTomecek.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}},"created_at":"2017-02-20T21:47:29.000Z","updated_at":"2024-11-29T15:06:38.000Z","dependencies_parsed_at":"2024-02-21T10:43:53.895Z","dependency_job_id":null,"html_url":"https://github.com/TomasTomecek/pretty-git-prompt","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fpretty-git-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fpretty-git-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fpretty-git-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fpretty-git-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasTomecek","download_url":"https://codeload.github.com/TomasTomecek/pretty-git-prompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826788,"owners_count":20354220,"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","prompt","zsh"],"created_at":"2024-10-06T01:05:59.888Z","updated_at":"2025-03-16T04:30:43.275Z","avatar_url":"https://github.com/TomasTomecek.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pretty-git-prompt\n\n[![Build Status](https://travis-ci.org/TomasTomecek/pretty-git-prompt.svg?branch=master)](https://travis-ci.org/TomasTomecek/pretty-git-prompt)\n\nYour current git repository information inside a beautiful shell prompt.\n\n![Preview of pretty-git-prompt](/data/example.png)\n\nFeatures:\n\n * You are able to display values such as:\n   * git repository state (resolving `merge` conflict, interactive `rebase`, ...)\n   * Current branch name.\n   * Count of changed, newly-added, staged, conflicting files.\n   * Number of items in stash.\n * You can track divergence against arbitrary branches.\n * Every value in output can be fully configured via a config file.\n * Sample configuration files feature colors.\n * The tool supports `zsh` and `bash`.\n * pretty-git-prompt is written in Rust programming language and is delivered as a single, statically-linked binary.\n\n\n## Development status\n\nThe tool is ready to use.\n\n\n## How can I try this out?\n\nVery easily! You don't need to install pretty-git-prompt if you just want to\nsee it in action. There is a make target which launches docker container with\nwhole environment set up.\n\nIt just takes some time to prepare the environment (create build environment,\ncompile the tool, run the demo).\n\nJust clone this git repository\n\n```\n$ git clone https://github.com/TomasTomecek/pretty-git-prompt\n```\n\nand run...\n\n\n### zsh\n\n```\n$ make zsh-demo\n```\n\nAnd this is what you should see:\n\n![Preview using zsh.](/data/zsh-screenshot.png)\n\nThis is an interactive shell, so you can play with it.\n\n\n### bash\n\nIn case you want to see the tool in bash shell:\n\n```\n$ make bash-demo\n```\n\n![Preview using bash.](/data/bash-screenshot.png)\n\nThis demo is one of the ways I verify that the tool works correctly.\n\n\n## Installation\n\nIf you want to add pretty-git-prompt inside your shell, this section contains\ninformation how to do that.\n\n\n### Obtaining `pretty-git-prompt` binary\n\n\n#### GitHub release\n\nGet the binary via [latest GitHub release](https://github.com/TomasTomecek/pretty-git-prompt/releases/latest).\n\nFor a linux distrubution:\n\n```\n$ curl -O https://github.com/TomasTomecek/pretty-git-prompt/releases/download/0.2.0/pretty-git-prompt-0.2.0-x86_64-unknown-linux-gnu\n```\n\nOr for MacOS:\n\n```\n$ curl -O https://github.com/TomasTomecek/pretty-git-prompt/releases/download/0.2.0/pretty-git-prompt-0.2.0-x86_64-apple-darwin\n```\n\n\n#### Compile it yourself\n\n```\n$ make build\n```\n\nAs stated inside demo section above, this takes some time.\n\nIf you have rust compiler and cargo available on your system, you can compile\nthe tool without using a container:\n\n```\n$ make exec-stable-build\n```\n\nThe binary is then available on this path:\n\n```\n$ ls -lha target/release/pretty-git-prompt\n-rwxr-xr-x 2 user group 1.7M May  9 21:37 target/release/pretty-git-prompt\n```\n\n\n### shell configuration\n\nBefore digging into `.bashrc` and `.zshrc`, please make sure that binary\n`pretty-git-prompt` is placed on your `$PATH`:\n\n```\n$ pretty-git-prompt\nmaster|✚1Δ1\n```\n\n### zsh\n\nThis seems to be the minimal config required:\n\n```shell\nexport LC_ALL=en_US.UTF-8\n# Load colors.\nautoload -U colors\ncolors\n# Allow for functions in the prompt.\nsetopt PROMPT_SUBST\nRPROMPT='\\$(pretty-git-prompt)'\n```\n\nJust put it inside your `~/.zshrc` and try it out.\n\n\n### bash\n\nYou should paste this inside your `~/.bashrc`:\n\n```\npretty_prompt() { PS1=\"$(pretty-git-prompt)\\n\\$ \"; }\nexport PROMPT_COMMAND=\"pretty_prompt ; $PROMPT_COMMAND\"\n```\n\nFor more info about the presented solution, please read these [superuser.com](https://superuser.com/a/623305/160542) and\n[stackoverflow](http://stackoverflow.com/a/13997892/909579) threads.\n\n\n## Solving problems\n\nIf you encounter a problem, you may run the tool with verbose output to help you resolve the issue:\n\n```\n$ pretty-git-prompt --debug\nDebug messages are enabled.\nThis is not a git repository: Error { code: -3, klass: 6, message: \"could not find repository from \\'.\\'\" }\n```\n\n\n## Configuration\n\nThe configuration is documented inside default config file. Therefore it's not\nexplicitly written down here. You can obtain it via:\n\n```\n$ pretty-git-prompt create-default-config\nConfiguration file created at \"/home/you/.config/pretty-git-prompt.yml\"\n```\n\nThis repository contains also configuration for bash and zsh with colors:\n\n1. [`files/pretty-git-prompt.yml.bash`](https://github.com/TomasTomecek/pretty-git-prompt/blob/master/files/pretty-git-prompt.yml.bash)\n2. [`files/pretty-git-prompt.yml.zsh`](https://github.com/TomasTomecek/pretty-git-prompt/blob/master/files/pretty-git-prompt.yml.zsh)\n\nIn case anything is not clear from the comments inside the config files, please\nopen a new issue.\n\n\n## Contributing\n\n### Support\n\nThis is an open source project. I don't guarantee any support. Everything is best effort.\n\n\n### Writing code\n\nThis project builds upon several principles:\n\n 1. Configurable as much as possible.\n 2. Pretty and useful.\n 3. As few dependencies as possible.\n 4. Easy to contribute to:\n    * Build with a single command.\n    * Build inside predictive environment.\n    * Test with a single command.\n\nIf you encounter any issue, please submit it! I will take a look. The best\nthing to do in the meanwhile is to try fixing it yourself.\n\nThe whole development environment should be trivial to setup, even run tests.\n\nAll you need is [docker](https://github.com/docker/docker) engine running and `make`.\n\nFirst you need to build container image with rust and all dependencies inside:\n\n```\n$ make nightly-environment\n```\n\nThis is using latest nightly rust. The nightly is used because of [clippy](https://github.com/Manishearth/rust-clippy).\n\nAnd then just make sure all tests are passing and you are not introducing any new warnings:\n\n```\n$ make test\n```\n\nIf any of the two `make` invocations above doesn't work for you, please open an issue.\n\n\n## Credits\n\nThis tool is heavily inspired by\n[zsh-git-prompt](https://github.com/olivierverdier/zsh-git-prompt). At some\npoint I realized, I wanted a more powerful tool so I wrote pretty-git-prompt.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomastomecek%2Fpretty-git-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomastomecek%2Fpretty-git-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomastomecek%2Fpretty-git-prompt/lists"}