Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rpfreitas111/204ac33c74e0a40d409da331d298890c to your computer and use it in GitHub Desktop.

Select an option

Save rpfreitas111/204ac33c74e0a40d409da331d298890c to your computer and use it in GitHub Desktop.

Revisions

  1. @danielalvarenga danielalvarenga renamed this gist Nov 24, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @danielalvarenga danielalvarenga revised this gist Nov 4, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion terminal-colors-branch
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Add in ~/.bashrc or ~/.bash_profile
    function parse_git_branch () {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }

    RED="\[\033[01;31m\]"
  3. @danielalvarenga danielalvarenga created this gist Nov 4, 2015.
    15 changes: 15 additions & 0 deletions terminal-colors-branch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Add in ~/.bashrc or ~/.bash_profile
    function parse_git_branch () {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
    }

    RED="\[\033[01;31m\]"
    YELLOW="\[\033[01;33m\]"
    GREEN="\[\033[01;32m\]"
    BLUE="\[\033[01;34m\]"
    NO_COLOR="\[\033[00m\]"

    # without host
    PS1="$GREEN\u$NO_COLOR:$BLUE\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "
    # with host
    # PS1="$GREEN\u@\h$NO_COLOR:$BLUE\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "