Skip to content

Instantly share code, notes, and snippets.

@opplatek
Last active January 11, 2024 09:56
Show Gist options
  • Save opplatek/150159d6ffb4c500de2246418e0bcded to your computer and use it in GitHub Desktop.
Save opplatek/150159d6ffb4c500de2246418e0bcded to your computer and use it in GitHub Desktop.
$ diff /etc/skel/.bashrc ~/.bashrc # to apply the diff run $ patch bashrcToBeChanged bashrc_diff
58a59,64
> ## Add git branch name to prompt https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
> parse_git_branch() {
> git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
> }
> #export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
>
60c66,67
< 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\]\$ '
> PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;35m\]$(parse_git_branch)\[\033[00m\]\$ '
82c89
< alias grep='grep --color=auto'
---
> alias grep='LC_ALL=C grep --color=auto' # default is without LC_ALL=C
117a125,127
>
> # Shorten path in prompt
> PROMPT_DIRTRIM=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment