Last active
April 17, 2024 10:04
-
-
Save tdd/473838 to your computer and use it in GitHub Desktop.
Config Bash pour un prompt Git de tueur
This file contains hidden or 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
# Envie de ZSH ? https://github.com/robbyrussell/oh-my-zsh | |
# | |
# Si vous n'avez pas déjà un /etc/bash_completion.d/git, regardez où se trouve le script de complétion | |
# sur votre plate-forme et chargez-le explicitement. Par exemple, avec Homebrew sur OSX, ça donnerait | |
# un truc du genre : | |
# source /usr/local/Cellar/git/1.7.10.4/etc/bash_completion.d/git-completion.bash | |
# | |
# source /usr/local/etc/bash_completion.d/git-completion.bash | |
# source /usr/local/etc/bash_completion.d/git-prompt.sh | |
# Éviter l'auto-édit en merge réussi à partir de Git 2.0 | |
export GIT_MERGE_AUTOEDIT=no | |
# Exportez au moins ces trois activations : modified/staged, stash present, untracked | |
export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 | |
export GIT_PS1_SHOWUPSTREAM=verbose GIT_PS1_DESCRIBE_STYLE=branch GIT_PS1_SHOWCOLORHINTS=1 | |
export PS1='\[\e[0;36m\][\A] \u@\h:\[\e[0m\e[0;32m\]\W\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[0;37m\] \$\[\e[0m\] ' | |
# Ou si tu ne veux pas des couleurs de dingue, plutôt celui du dessous : | |
# export PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ ' | |
# Envie de trucs carrément plus bourrins ? | |
# https://github.com/matthewmccullough/dotfiles/blob/master/bash_gitprompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Si on a installé git avec Homebrew et que l'on veut lancer git-completion.bash et git-prompt.sh, on peut écrire
pour expliciter les choses, même si ça revient dans la plupart des configurations à
Viser une version en particulier est problématique après upgrade et cleanup…