Add Git Branch Name to Terminal Prompt (Mac)


#1

When in a repository directory you can show the name of the currently checked out Git branch in the prompt, making it easier to track where you are (and where you're about to commit).


This is a companion discussion topic for the original entry at https://www.pymadethis.com/article/add-git-branch-name-to-terminal-prompt-mac/

#2

Thank you!


#3

Thank you ;-)


#4

Simple solution, clear explanation. Thanks!


#5

Thanks ! it worked perfectly for Ubuntu 13.04 too


#6

Thanks a lot, really useful snippet!


#7

Thanks a ton for this information!


#8

Nice! Thanks a bunch.


#9

If anyone finds that this isn't working in Ubuntu, add the lines of code above to the file .bashrc (located at ~/.bashrc - if it doens't exist, just run "touch ~/.bashrc")


#10

Nice post. It works for Mac OS Mavericks as well.


#11

got permission denied too, when sourcing the ~/.bash_profile. how do I fix this?


#12

Thanks a lot


#13

Thank you! very helpful and easy.


#14

Great! Thanks


#15

perfect, thanks!


#16

Thanks


#17

Thanks a lot!


#18

You da man


#19

You rock!


#20

really useful:) Thanks Martin!