Skip to content

Display current SVN branch name in your terminal prompt when in a SVN working directory.

License

Notifications You must be signed in to change notification settings

malfter/svn-aware-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVN Aware Prompt

Overview

If you cd to a SVN working directory, you will see the current SVN relative URL name displayed in your terminal prompt (based on the svn common patterns). When you're not in a SVN working directory, your prompt works like normal.

Installation

Clone the project to a .bash folder in your home directory:

mkdir ~/.bash
cd ~/.bash
git clone [email protected]:malfter/svn-aware-prompt.git

Edit your ~/.bash_profile or ~/.profile and add the following to the top:

export SVNAWAREPROMPT=~/.bash/svn-aware-prompt
source $SVNAWAREPROMPT/main.sh

Configuring

Once installed, there will be new $svn_branch and $svn_dirty variables available to use in the PS1 environment variable, along with a number of color helper variables which you can see a list of in colors.sh.

If you want to know more about how to customize your prompt, I recommend this article: How to: Change / Setup bash custom prompt (PS1)

Suggested Prompts

Below are a few suggested prompt configurations. Simply paste the code at the end of the same file you pasted the installation code into earlier.

Mac OS X

export PS1="\u@\h \w \[$txtcyn\]\$svn_branch\[$txtred\]\$svn_dirty\[$txtrst\]\$ "

Optionally, if you want a nice pretty prompt when using sudo -s, also add this line:

export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\$ "

Ubuntu

Standard:

export PS1="\${debian_chroot:+(\$debian_chroot)}\u@\h:\w \[$txtcyn\]\$svn_branch\[$txtred\]\$svn_dirty\[$txtrst\]\$ "

Colorized:

export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$svn_branch\[$txtred\]\$svn_dirty\[$txtrst\]\$ "

Updating

Assuming you followed the default installation instructions and cloned this repo to ~/.bash/svn-aware-prompt:

cd ~/.bash/svn-aware-prompt
git pull

Thank you

This project based on jimeh/git-aware-prompt.

Thank you for your work!

License

CC0 1.0 Universal

About

Display current SVN branch name in your terminal prompt when in a SVN working directory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages