Skip to content

Instantly share code, notes, and snippets.

@kahunacohen
Last active August 1, 2023 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahunacohen/c849e7f2aeeee8a9fc1b9f26b1203763 to your computer and use it in GitHub Desktop.
Save kahunacohen/c849e7f2aeeee8a9fc1b9f26b1203763 to your computer and use it in GitHub Desktop.
matav .bash_profile
# General
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH=$PATH:$HOME/bin
# git
alias gd="git diff"
alias gs='git status'
alias gp='git push'
alias latest_tag='git tag | sort -V | tail -n1'
alias diff_latest_tag='git diff `latest_tag`'
# git commit -am
gca() {
git commit -am "$1"
}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
delete_local_branch() {
git branch -d "$1"
}
delete_remote_branch() {
read -p "Are you sure you want to perform this action? (y/n): " response
if [[ $response =~ ^[Yy]$ ]]; then
git push origin -d "$1"
else
echo "Action canceled."
fi
}
export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment