将以下代码追加到自己的home目录下的 .bashrc文件中

echo 'PS1="$PS1\$($( cat $HOME/bin/git-ps1.sh ))"' >> ~/.bashrc

 

需要下载的文件:  git-ps1.sh

tar -xzvf git-ps1.tar.gz.zip

mv git-ps1.sh ~/bin/

 

重启终端,再进入git分支就可以看到效果了

zhxia@zhxia:~/projects/v2$ [hotfix-loupan_comm_remap]

相关文章:

  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-09-19
  • 2021-11-29
猜你喜欢
  • 2022-01-26
  • 2021-03-31
  • 2022-12-23
  • 2021-07-28
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案