git aliases for pushing branches
This commit is contained in:
parent
f0aa65ef56
commit
056fc58616
@ -7,6 +7,7 @@
|
||||
alias cm='chezmoi'
|
||||
alias gcls='git clone --depth 1 --recurse-submodules'
|
||||
alias gpar='gitpushallremote'
|
||||
alias gpcr='gitpushcurrentremote'
|
||||
alias lg='lazygit'
|
||||
alias neworigin='setorigin'
|
||||
alias origin='setorigin'
|
||||
|
@ -336,12 +336,21 @@ function setorigin {
|
||||
copyhooks
|
||||
fi
|
||||
}
|
||||
function gitpushcurrentremote {
|
||||
gitpushallremote "$(git_current_branch)"
|
||||
}
|
||||
function gitpushallremote {
|
||||
local param_branch="$1"
|
||||
grv
|
||||
grv | grep push | awk '{print $1}' | while read -r remote
|
||||
do
|
||||
arrow "$remote"
|
||||
git push --all "$remote"
|
||||
if [ -z "$param_branch" ]; then
|
||||
arrow "pushing all branches to $remote"
|
||||
git push --all "$remote"
|
||||
else
|
||||
arrow "pushing $param_branch to $remote"
|
||||
git push "$remote" "$param_branch"
|
||||
fi
|
||||
done
|
||||
}
|
||||
function clone {
|
||||
|
Loading…
Reference in New Issue
Block a user