Skip to main content

Display git repository information in a command prompt.

Project description

GitPrompt displays the current branch, the status of stash and rebase, and optionally, non-zero exit status codes.

Examples

To follow along, create a new repository and set your prompt:

$ git init; touch x; git add x; git commit -m x
$ export PS1='cwd$(../gitprompt $?) $ '

The current branch is displayed:

cwd master $ git checkout -b new
cwd new $ git checkout master
cwd master $ echo y1 > y; git add y; git commit -m y1; git checkout new

The number of saved stashes is indicated:

cwd new $ echo y2 > y; git add y; git stash save
cwd new stash $ touch z; git add z; git stash save
cwd new stashes! $ git stash pop ; git stash pop

Whether a rebase is in progress is indicated:

cwd new $ git rebase master
cwd new rebase! $ git rebase --abort
cwd new $ git config core.editor true; git rebase --interactive master
cwd new rebase! $ git rebase --abort

If gitprompt was passed a non-zero exit code, it will be displayed:

cwd new $ true
cwd new $ false
=> 1
cwd new $

History

0.1 – 2009 Oct 23

  • Display the current branch and the status of stash and rebase.

  • Optionally display non-zero exit codes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

GitPrompt-0.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file GitPrompt-0.1.tar.gz.

File metadata

  • Download URL: GitPrompt-0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for GitPrompt-0.1.tar.gz
Algorithm Hash digest
SHA256 bf2258c14dd4460c1e7a26808b22a697a06cb53a0ef4715d5ed3c5cef6852e54
MD5 50b28722faa4f8aa1bf3ac4a6fd902b5
BLAKE2b-256 fbe09c7b58a127d1cdbfabf318258e1e0fef0da15b88677cdb0053aa69a45ace

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page