Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The git package installed on your system includes bash files to aid you in creating an informative prompt. To create colors, you will need to insert terminal escape sequences into your prompt. And, the final ingredient is to update your prompt after each command gets executed by using the built-in variable PROMPT_COMMAND.</p> <p>Edit your ~/.bashrc to include the following, and you should get the prompt in your question, modulo some color differences.</p> <pre><code># # Git provides a bash file to create an informative prompt. This is its standard # location on Linux. On Mac, you should be able to find it under your Git # installation. If you are unable to find the file, I have a copy of it on my GitHub. # # https://github.com/chadversary/home/blob/42cf697ba69d4d474ca74297cdf94186430f1384/.config/kiwi-profile/40-git-prompt.sh # source /usr/share/git/completion/git-prompt.sh # # Next, we need to define some terminal escape sequences for colors. For a fuller # list of colors, and an example how to use them, see my bash color file on my GitHub # and my coniguration for colored man pages. # # https://github.com/chadversary/home/blob/42cf697ba69d4d474ca74297cdf94186430f1384/.config/kiwi-profile/10-colors.sh # https://github.com/chadversary/home/blob/42cf697ba69d4d474ca74297cdf94186430f1384/.config/kiwi-profile/40-less.sh # color_start='\e[' color_end='m' color_reset='\e[0m' color_bg_blue='44' # # To get a fancy git prompt, it's not sufficient to set PS1. Instead, we set PROMPT_COMMAND, # a built in Bash variable that gets evaluated before each render of the prompt. # export PROMPT_COMMAND="PS1=\"\${color_start}\${color_bg_blue}\${color_end}\u@\h [\w\$(__git_ps1 \" - %s\")]\${color_reset}\n\$ \"" # # If you find that the working directory that appears in the prompt is ofter too long, # then trim it. # export PROMPT_DIRTRIM=3 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload