Add git-up command
This commit is contained in:
parent
1dcafb48c4
commit
323a70f596
21
bin/git-up
Executable file
21
bin/git-up
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: git up {branch} {remote}
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $# < 1 ]]; then
|
||||
echo "You must specify a branch name to update"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BRANCH=$1
|
||||
REMOTE=${2:-origin}
|
||||
|
||||
git checkout ${BRANCH} && \
|
||||
git fetch ${REMOTE} && \
|
||||
echo && \
|
||||
git sl ${BRANCH}..${REMOTE}/${BRANCH} && \
|
||||
echo && \
|
||||
git pull --quiet && \
|
||||
git checkout -
|
Loading…
Reference in a new issue