Last active
April 17, 2024 10:04
Revisions
-
tdd revised this gist
Jul 27, 2015 . 1 changed file with 20 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +1,31 @@ # STEP 1: ENSURE COMPLETION AND PROMPT FUNCTION ARE LOADED # ======================================================== # OPTION 1: If on OSX using Homebrew: # # source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh # source $(brew --prefix)/etc/bash_completion.d/git-completion.bash # OPTION 2: If on OSX using built-in Git (also works on ZSH): # # source /usr/local/git/contrib/completion/git-prompt.sh # source /usr/local/git/contrib/completion/git-completion.bash # OPTION 3: If on Ubuntu/Debian/Mint using standard packages, or on Windows: pre-loaded! # STEP 2: CONFIGURE THE PROMPT # ============================ # Configure `__git_ps1` to tell us as much as possible 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 GIT_PS1_HIDE_IF_PWD_IGNORED=1 # Colorful prompt for Bash! 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\] ' # Or if you want the basic prompt, no colors, no timestamps, just regular + Git info: # export PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ ' # Unrelated but useful: avoid auto-édit on successful merges, starting with Git 2.0 export GIT_MERGE_AUTOEDIT=no -
tdd revised this gist
Jan 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export GIT_MERGE_AUTOEDIT=no 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)")\$ ' -
tdd revised this gist
Jan 30, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,10 +17,10 @@ export GIT_MERGE_AUTOEDIT=no 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 -
tdd revised this gist
Jan 30, 2015 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,10 @@ # 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 -
tdd revised this gist
Oct 17, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,5 +15,8 @@ export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFI export GIT_PS1_SHOWUPSTREAM=verbose GIT_PS1_DESCRIBE_STYLE=branch GIT_PS1_SHOWCOLORHINTS=1 export PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ ' # Ou si tu veux des couleurs de dingue, plutôt celui du dessous : # 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\]' # Envie de trucs carrément plus bourrins ? # https://github.com/matthewmccullough/dotfiles/blob/master/bash_gitprompt -
tdd revised this gist
Oct 9, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ # 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='\u@\h:\W$(__git_ps1 " (%s)")\$ ' # Envie de trucs carrément plus bourrins ? -
tdd revised this gist
Jan 30, 2013 . 1 changed file with 16 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,18 @@ # 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 # 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 PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ ' # Envie de trucs carrément plus bourrins ? # https://github.com/matthewmccullough/dotfiles/blob/master/bash_gitprompt -
tdd revised this gist
Jan 25, 2012 . 1 changed file with 6 additions and 113 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,114 +1,7 @@ # .git-completion.bash est en fait fourni par les paquets Git divers et variés… # * Paquet Ubuntu/Debian : /etc/bash_completion.d/git (probablement déjà chargé par votre shell Bash) # * Homebrew (OSX) : /usr/local/Cellar/git/1.7.4.1/etc/bash_completion.d/git-completion.bash source "$HOME/.git-completion.bash" && export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 && export PS1='\u@\h:\W$(__git_ps1 " (%s)")\$ ' -
tdd revised this gist
Jul 13, 2010 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -109,4 +109,6 @@ __git_ps1 () } export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 GIT_PS1_SHOWSTASHSTATE=1 # En fait l'important ici c'est le "\033[1;32m\]$(__git_ps1)\[\033[0m\]", le reste c'est mon prompt usuel… export PS1='\[\033[0;37m\]\u@\h:\[\033[0;33m\]\W\[\033[0m\]\[\033[1;32m\]$(__git_ps1)\[\033[0m\] \$ ' -
tdd created this gist
Jul 13, 2010 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,112 @@ # Scavenged from Git 1.6.5.x contrib/completion/git_completion.bash # __git_ps1 accepts 0 or 1 arguments (i.e., format string) # returns text to add to bash PS1 prompt (includes branch name) __gitdir () { if [ -z "${1-}" ]; then if [ -n "${__git_dir-}" ]; then echo "$__git_dir" elif [ -d .git ]; then echo .git else git rev-parse --git-dir 2>/dev/null fi elif [ -d "$1/.git" ]; then echo "$1/.git" else echo "$1" fi } __git_ps1 () { local g="$(__gitdir)" if [ -n "$g" ]; then local r local b if [ -f "$g/rebase-merge/interactive" ]; then r="|REBASE-i" b="$(cat "$g/rebase-merge/head-name")" elif [ -d "$g/rebase-merge" ]; then r="|REBASE-m" b="$(cat "$g/rebase-merge/head-name")" else if [ -d "$g/rebase-apply" ]; then if [ -f "$g/rebase-apply/rebasing" ]; then r="|REBASE" elif [ -f "$g/rebase-apply/applying" ]; then r="|AM" else r="|AM/REBASE" fi elif [ -f "$g/MERGE_HEAD" ]; then r="|MERGING" elif [ -f "$g/BISECT_LOG" ]; then r="|BISECTING" fi b="$(git symbolic-ref HEAD 2>/dev/null)" || { b="$( case "${GIT_PS1_DESCRIBE_STYLE-}" in (contains) git describe --contains HEAD ;; (branch) git describe --contains --all HEAD ;; (describe) git describe HEAD ;; (* | default) git describe --exact-match HEAD ;; esac 2>/dev/null)" || b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." || b="unknown" b="($b)" } fi local w local i local s local u local c if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then c="BARE:" else b="GIT_DIR!" fi elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then git diff --no-ext-diff --ignore-submodules \ --quiet --exit-code || w="*" if git rev-parse --quiet --verify HEAD >/dev/null; then git diff-index --cached --quiet \ --ignore-submodules HEAD -- || i="+" else i="#" fi fi fi if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$" fi if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then if [ -n "$(git ls-files --others --exclude-standard)" ]; then u="%" fi fi fi if [ -n "${1-}" ]; then printf "$1" "$c${b##refs/heads/}$w$i$s$u$r" else printf " (%s)" "$c${b##refs/heads/}$w$i$s$u$r" fi fi } export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 GIT_PS1_SHOWSTASHSTATE=1 export PS1='\[\033[0;37m\]\u@\h:\[\033[0;33m\]\W\[\033[0m\]\[\033[1;32m\]$(__git_ps1)\[\033[0m\] \$ '