Integrate branch jumping during git ps
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
10b2be5a1a
commit
ebc6c7bb02
1 changed files with 15 additions and 10 deletions
11
bin/git-ps
11
bin/git-ps
|
@ -1,10 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
set -o pipefail
|
|
||||||
set -e
|
|
||||||
|
|
||||||
source "${HOME}/bin/script_framework.sh"
|
source "${HOME}/bin/script_framework.sh"
|
||||||
|
|
||||||
|
jump_branch="${1:-}"
|
||||||
|
|
||||||
step "Loading required keys to pull"
|
step "Loading required keys to pull"
|
||||||
git loadkey
|
git loadkey
|
||||||
|
|
||||||
|
@ -14,6 +14,11 @@ for remote in $(git remote -v | awk '{print $1}' | sort | uniq); do
|
||||||
git fetch -p ${remote} --tags
|
git fetch -p ${remote} --tags
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[[ -z ${jump_branch} ]] || {
|
||||||
|
step "Switching to branch ${jump_branch}"
|
||||||
|
git checkout "${jump_branch}"
|
||||||
|
}
|
||||||
|
|
||||||
step "Rebasing branch / updating submodules..."
|
step "Rebasing branch / updating submodules..."
|
||||||
git pull --rebase && git submodule update --init --recursive
|
git pull --rebase && git submodule update --init --recursive
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue