Created
July 23, 2013 16:04
Revisions
-
vanhalt created this gist
Jul 23, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ # Your stuffs PATH="$PATH:/Users/your_name/bin" # add the python script to your path PS1='\w [$(git_branch)] >> ' # the magic are the single quotes ;) # more of your stuffs This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!usr/bin/python import subprocess import sys branches = subprocess.Popen(["git", "branch"], stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0] name = '-' for branch in branches.split("\n"): if branch.find('*') > -1: name = branch.split('*')[-1].strip() sys.stdout.write(name)