.bashrc:

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w$(__git_ps1 " (%s)")\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")\$ '
fi

export GIT_PS1_SHOWDIRTYSTATE=1 to show unstaged (*) and staged (+) changes next to the branch name.

export GIT_PS1_SHOWUNTRACKEDFILES=1 to show untracked files (%).

read /etc/bash_completion.d/git for more.

相关文章:

  • 2021-07-18
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-07-07
  • 2021-10-28
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-11-16
  • 2021-07-20
  • 2022-02-13
  • 2021-12-12
相关资源
相似解决方案