Bash git-prompt: Difference between revisions

From wikipost
Jump to navigation Jump to search
(Created page with " ---automatically change the prompt when you're in a git directory--- <pre> ---[~/.bashrc]--- # uncomment these 5 lines to automatically show a different PS1 prompt when you enter a git directory GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 GIT_PS1_SHOWCOLORHINTS=true PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "' source /usr/lib/git-core/git-sh-prompt ---[]--- </pre>")
 
No edit summary
Line 1: Line 1:


---automatically change the prompt when you're in a git directory---
automatically change the prompt when you're in a git directory


<pre>
<pre>

Revision as of 01:42, 9 February 2024

automatically change the prompt when you're in a git directory




   ---[~/.bashrc]---
   # uncomment these 5 lines to automatically show a different PS1 prompt when you enter a git directory
   GIT_PS1_SHOWDIRTYSTATE=1
   GIT_PS1_SHOWUNTRACKEDFILES=1
   GIT_PS1_SHOWCOLORHINTS=true
   PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
   source /usr/lib/git-core/git-sh-prompt
   ---[]---