config/git: rework git-p
This commit is contained in:
parent
b6fd5446c6
commit
5a82e182fc
|
@ -136,12 +136,10 @@
|
||||||
|
|
||||||
# Change remote
|
# Change remote
|
||||||
luu = !git pull upstream $(git curbranch) && git push --no-verify
|
luu = !git pull upstream $(git curbranch) && git push --no-verify
|
||||||
p = push
|
|
||||||
pu = push -u
|
|
||||||
pf = push --force-with-lease
|
pf = push --force-with-lease
|
||||||
cap = !git commit --all --amend --no-edit && git 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"
|
path = "~/.config/yadm/gitconfig"
|
||||||
|
|
||||||
[includeIf "gitdir:~/data/.git"]
|
[includeIf "gitdir:~/data/.git"]
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
git rev-parse @{u} 2>/dev/null >/dev/null && git push || git push --set-upstream
|
|
@ -3,5 +3,5 @@
|
||||||
# With no argument it switches to the default branch and deletes the current branch.
|
# With no argument it switches to the default branch and deletes the current branch.
|
||||||
branch=${1:-$(git curbranch)}
|
branch=${1:-$(git curbranch)}
|
||||||
echo "${@:-$branch}" | sed 's/\([^ ]\+\)/\1@{push}/g' | xargs git rev-parse --abbrev-ref --revs-only | sed 's/\// /' | git push -d
|
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}"
|
git branch -D "${@:-$branch}"
|
||||||
|
|
Loading…
Reference in New Issue