Last active
September 18, 2018 09:32
-
-
Save massongit/40620659e72f8c87ef734323443fe706 to your computer and use it in GitHub Desktop.
UbuntuのCLI上でGitを快適に使えるようにする方法 ( https://qiita.com/SUZUKI_Masaya/items/5abe232fa85d11ee89ea )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- .bashrc 2018-05-27 11:00:45.318699382 +0900 | |
+++ .bashrc_ 2018-05-27 10:55:21.144009944 +0900 | |
@@ -56,11 +56,22 @@ | |
fi | |
fi | |
+# スクリプト読み込み | |
+source ~/.git_completion/contrib/completion/git-completion.bash | |
+source ~/.git_completion/contrib/completion/git-prompt.sh | |
+ | |
+# CLIでのGitの状態の表示設定 | |
+export GIT_PS1_SHOWDIRTYSTATE=1 | |
+export GIT_PS1_SHOWUPSTREAM=1 | |
+export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
+export GIT_PS1_SHOWSTASHSTATE=1 | |
+ | |
if [ "$color_prompt" = yes ]; then | |
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]' | |
else | |
- PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
+ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w' | |
fi | |
+ | |
+PS1="$PS1\[\033[1;31m\]\$(__git_ps1)\[\033[00m\]\$ " | |
+ | |
unset color_prompt force_color_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment