mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-23 00:18:00 +00:00
[.zshrc] Add alias for git "dirty" squash
This commit is contained in:
parent
aad77aa8d6
commit
e5ca1076d4
16
.zshrc
16
.zshrc
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user