Custom powerfull bash prompt.
- autodetection of GIT dirs
- kubernetes context name and current namespace
- various usefull functions and aliases
You can see some basic information. From the left username@hostname, actual time, actual working directory. On the next line you can see bash command reference number of actual command. You can repeat command from history by typing this string eg !2167
In first we execute command false, so you can see indication on the next prompt with red sign (!)
, it means that last command has non 0 return code.
- Prompt automatically detect that you are in GIT repository and display some basic git info like actual REF, Modified files, Added files and Deleted file.
- It can also detect Git Submodules and gives you indication of that
- It inform you if you have stashed changes in git
- you can turn off git prompt permanently in
.bash_func
or temporarly withgitprompt off
- For gitlab you can see your gitlab user.name and email
- you can turn off gituser prompt permanently in
.bash_func
or temporarly withgituserprompt off
- For kubernetes you can see current active context and default namespace for that context.
- you can turn off kube prompt permanently in
.bash_func
or temporarly withkubeprompt off
GIT
log
, viz screenshotlogd
, viz screenshotcommit
forgit commit -a -m
cm
forgit commit -m
push
forgit push
check
forgit checkout
fetch
forgit fetch
subup
forgit submodule update
subpull
forfit submodule foreach git pull
gnew
forgit checkout -b
Kubernetes
k
for kubectlkcon
for changing kubernetes config contextkname
for changing default namespace for contextkshow
for showing all contexts
Debian/Ubuntu packaging
pkgi
, forsudo apt-get install
pkgs
, forapt-cache search
pkgr
, forsudo apt-get remove
Others
fuck
, run last command with sudosvim
, run vim with sudo
Copy all '.bash' files to your home directory
git clone https://github.com/rvojcik/bash-git-prompt.git
cd bash-git-prompt
cp -rfp ./.bash* ~/
If you have some own customization of these files, backup them first.
cd ~/
mkdir backup-files
cp -rfp ~/.bash* ~/backup-files/