在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jimeh/git-aware-prompt开源软件地址:https://github.com/jimeh/git-aware-prompt开源编程语言:Shell 100.0%开源软件介绍:Git Aware PromptWorking with Git and its great branching/merging features is
amazing. Constantly switching branches can be confusing though as you have to
run The solution to this is to have your terminal prompt display the current branch. There's a number of articles available online about how to achieve this. This project is an attempt to make an easy to install/configure solution. OverviewIf you InstallationClone the project to a mkdir ~/.bash
cd ~/.bash
git clone git://github.com/jimeh/git-aware-prompt.git Edit your export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh" ConfiguringOnce installed, there will be new If you want to know more about how to customize your prompt, I recommend this article: How to: Change / Setup bash custom prompt (PS1) Suggested PromptsBelow are a few suggested prompt configurations. Simply paste the code at the end of the same file you pasted the installation code into earlier. Mac OS Xexport PS1="\u@\h \W \[\$txtcyn\]\$git_branch\[\$txtred\]\$git_dirty\[\$txtrst\]\$ " Optionally, if you want a nice pretty prompt when using export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\$ " UbuntuStandard: export PS1="\${debian_chroot:+(\$debian_chroot)}\u@\h:\w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ " Colorized: export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ " Windowsexport PS1="\[\033]0;$MSYSTEM:\w\007\033[32m\]\u@\h:\[\033[33m\w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\033[0m\]\$ " UpdatingAssuming you followed the default installation instructions and cloned this
repo to cd ~/.bash/git-aware-prompt
git pull Usage TipsTo view other user's tips, please check the Usage Tips wiki page. Or if you have tips of your own, feel free to add them :) License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论