Adding git branch on the Bash command prompt

前端 未结 13 2077
感情败类
感情败类 2020-11-30 16:15

I tried adding the git branch I\'m currently working on (checked-out) on the bash prompt without success.. (while keeping my current path which shows the active dir

13条回答
  •  庸人自扰
    2020-11-30 16:52

    If you use the fish shell its quite straight forward. fish is an interactive shell which comes with lots of goodies. You can install it using apt-get.

    sudo apt-get install fish
    

    you can then change the prompt setting using

    > fish_config 
    Web config started at 'http://localhost:8001/'. Hit enter to stop.
    Created new window in existing browser session.
    

    now go to http://localhost:8001/ open the prompt tab and choose the classic + git option

    Now click on the use prompt button and you are set.

提交回复
热议问题