diff --git a/dot_zsh_aliases b/dot_zsh_aliases index 800b423..c76256f 100644 --- a/dot_zsh_aliases +++ b/dot_zsh_aliases @@ -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' diff --git a/dot_zsh_functions b/dot_zsh_functions index 94d9883..b7addbb 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -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 {