Skip to content

Instantly share code, notes, and snippets.

View cuneytcorbaci's full-sized avatar

Cüneyt Çorbacı cuneytcorbaci

View GitHub Profile
@cuneytcorbaci
cuneytcorbaci / bash_PS1_Color_Branch_Name.sh
Created September 24, 2024 21:54
Add Bash PS1 Color Branch Name
# In above PS1 we defined following properties
# \u@\h \[\033[32m\] — user, host name and its displaying color
# \w\[\033[33m\] — current working directory and its displaying color
# \$(parse_git_branch)\[\033[00m\] — git branch name and its displaying color
# Add the end of the ~/.bashrc file and then run "source ~/.bashrc" command.
# For color types "https://gist.github.com/cuneytcorbaci/9b50b0dd679bc6adfc95505fd7f8d958"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@cuneytcorbaci
cuneytcorbaci / .bash_aliases
Last active September 24, 2024 21:51 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset