config/git: little alias improvements

This commit is contained in:
xeruf 2021-05-06 08:29:05 +02:00
parent dcad94ba64
commit 1fe58f4f40
4 changed files with 10 additions and 7 deletions

View File

@ -115,7 +115,7 @@
cme = commit -v --edit --message cme = commit -v --edit --message
cp = cherry-pick cp = cherry-pick
rb = rebase --autostash rb = rebase
rbi = rebase --interactive rbi = rebase --interactive
rbc = rebase --continue rbc = rebase --continue
rbm = !git rb $(git main) rbm = !git rb $(git main)

View File

@ -87,7 +87,7 @@ gitremote() {
git:*) echo "$1" ;; git:*) echo "$1" ;;
*) test "$3" = "cau" && 3="CAU-Kiel-Tech-Inf" *) test "$3" = "cau" && 3="CAU-Kiel-Tech-Inf"
test "$3" = "btl" && 3="betweenthelinesev" test "$3" = "btl" && 3="betweenthelinesev"
echo "git@${1:-github.com}:${3:-xerus2000}/${2:-$(basename $PWD)}.git" ;; echo "git@${1:-github.com}:${3:-$(git config user.name)}/${2:-$(basename $PWD)}.git" ;;
esac esac
} }

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
if git rev-parse @{u} 2>/dev/null >/dev/null if git rev-parse @{upstream} >/dev/null 2>&1
then git push "$@" then git push "$@"
else git push --set-upstream "$@" else git push --set-upstream "$@"
fi fi

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
# Interactive rebase onto the remote # Interactive rebase onto the given committish, the matching upstream branch
remote="$1" # or the first named ref from the history if there is no upstream yet.
test $# -gt 0 && shift if test $# -gt 0
git rebase -i ${remote:-'@{push}'} "$@" then remote="$1"; shift
else remote=$(git rev-parse --verify --quiet @{push} || git rev-parse $(git describe --all HEAD~ | cut -d '-' -f-2))
fi
git rebase -i "$remote" "$@"