diff --git a/.config/git/config b/.config/git/config index 5a57931..703d8eb 100644 --- a/.config/git/config +++ b/.config/git/config @@ -136,12 +136,10 @@ # Change remote luu = !git pull upstream $(git curbranch) && git push --no-verify - p = push - pu = push -u pf = push --force-with-lease cap = !git commit --all --amend --no-edit && git push --force-with-lease -[includeIf "gitdir:~/.config/yadm/repo.git"] +[includeIf "gitdir:yadm/repo.git"] path = "~/.config/yadm/gitconfig" [includeIf "gitdir:~/data/.git"] diff --git a/.local/bin/scripts/git-p b/.local/bin/scripts/git-p new file mode 100755 index 0000000..cd25769 --- /dev/null +++ b/.local/bin/scripts/git-p @@ -0,0 +1,2 @@ +#!/bin/sh +git rev-parse @{u} 2>/dev/null >/dev/null && git push || git push --set-upstream diff --git a/.local/bin/scripts/git-rmbranch b/.local/bin/scripts/git-rmbranch index 0ae089d..8423666 100755 --- a/.local/bin/scripts/git-rmbranch +++ b/.local/bin/scripts/git-rmbranch @@ -3,5 +3,5 @@ # With no argument it switches to the default branch and deletes the current branch. branch=${1:-$(git curbranch)} echo "${@:-$branch}" | sed 's/\([^ ]\+\)/\1@{push}/g' | xargs git rev-parse --abbrev-ref --revs-only | sed 's/\// /' | git push -d -test $1 || git checkout main || git checkout master || git checkout $(cat .git/refs/remotes/origin/HEAD | cut -d'/' -a) +test $1 || git checkout main 2>/dev/null || git checkout master || git checkout $(cat .git/refs/remotes/origin/HEAD | cut -d'/' -a) git branch -D "${@:-$branch}"