1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-23 04:58:00 +00:00

[.zshrc] Add alias for git "dirty" squash

This commit is contained in:
Daniel Carrillo 2022-07-08 19:29:48 +02:00
parent aad77aa8d6
commit e5ca1076d4
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16

16
.zshrc
View File

@ -73,6 +73,22 @@ kexec () {
[ -n "$cid" ] && kubectl exec -ti "$cid" -- "${cmd[@]}" [ -n "$cid" ] && kubectl exec -ti "$cid" -- "${cmd[@]}"
} }
# "dirty" squash before merge
git_squash () {
if [ -z $2 ]; then
echo "Usage: $0 <base branch> \"commit message\""
return 1
fi
local bbranch=$1
local message=$2
local cbranch=$(git branch --show-current)
git reset $(git merge-base $bbranch $cbranch)
git add -A
git commit -m "$message"
}
##### tilix ##### ##### tilix #####
if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then