Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!


vcprompt is a little C program that prints a short string, designed to
be included in your prompt, with barebones information about the current
working directory for various version control systems.  It is designed
to be small and lightweight rather than comprehensive.

Currently, it knows how to get (and print) the current branch for CVS,
Git, and Mercurial working copies.  Eventually, I plan to add support
for Subversion and Bazaar, and give it the (optional) ability to also
indicate how dirty the working copy is, i.e. whether there are unknown
files and whether there are local changes (modified/removed/added

vcprompt currently has no external dependencies: it does everything with
the standard C library.  I suspect this will not last long: e.g. to
determine anything about a Subversion working copy will probably require
using the Subversion C API.

To compile vcprompt:


To install it:

  cp -p vcprompt ~/bin

To use it with bash, just call it in PS1:

  PS1='\u@\h:\w $(vcprompt)\$'

To use it with zsh, you need to enable shell option PROMPT_SUBST, and
then do similarly to bash:

  setopt prompt_subst
  PROMPT='[%n@%m] [%~] $(vcprompt)'

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.