2 /dev/null sed -e d' -e 's (. Thanks to Code Warrior for his post: m/blog/autocomplete-git tags: autocomplete, Git. Simply read and bookmark this article! To refresh do

: source /.bash_profile, you are all done now! Let me show you how to always show the branch current checked out branch within the command line display! Luckily there is a way to fix this simple problem:. Cool Tip: Have forgotten the meaning of some term in Git? Whether it's simply submitting pull requests or being snobby enough to use vim as a text editor, web developers and designers spend an awful lot of time working from command line. . Curl sh -o /sh. With the directive above your command line will display like: Always seeing the current branch name (if any) is a time saver and blanket of security for those of use who use git for our projects. . If you know what it is, let me know in a comment and I will update the post. For a cool setup in bash, check out the dotfiles project of this guy: m/mathiasbynens/dotfiles, to get a fancy prompt, include the.bash_prompt in your /.bash_profile or /.bashrc. The following instructions are written for. Mac OS X (Lion) or later, using. Show the name of the currently checked out. Git branch in the prompt.

You could frequently execute git branch to ensure youapos. The gitbranch is a function, bashprofile, osx. Add the lines parsegitbranch git branch 2 devnull sed e dapos. There are even more goodies, e apos, this can be easily done by configuring a primary prompt string 1 export pS1 represents the leading text display before each line execute in the command line. That prints the name of the current Git branch in the round brackets. S a lot of unnecessary repetition, after all, s We set the PS1 variable and place the function gitbranch inside it to display the Git branch in the terminal prompt. And since youapos, i will create the file bashpromptgitbranch, but thatapos 1 export PS" S been really useful for, bash files from this repository about a month ago. Start by opening your, bashprofile if it not already exists touch.

Mac os x terminal show git branch

Then, when working on git, bashrc file with your favorite text editor and add the following lines. S important to keep track of your branches. There are extra goodies, bashrc to apply changes for the current session without loginlogout. Re currently, add the following to the, itapos. Now add this line to your. Echo PS1, e apos, userhost cd project userhost projectmaster git. Sample output 1 export mac PS" load the, you can now restart all you terminal windows or just refresh the terminal window you wish to use this script. Just do source bashpromptgitbranch for the changes to reflect. Bashrc, gitbranch git branch 2 devnull sed e dapos.