Skip to content

Commit

Permalink
- get current branch after entering the directory
Browse files Browse the repository at this point in the history
  • Loading branch information
almir authored Nov 2, 2016
1 parent 15eb354 commit 9052538
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions auto-update-repo/update-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ SCRIPTPATH=$(readlink -f "$(dirname "$(readlink -f ${0})")")
# Get stript's name
SCRIPTNAME=$(basename ${0})

# Get the branch currently used
CURBRANCH=$(git rev-parse --abbrev-ref HEAD)

check_and_update() {
# Get inside the git repo directory
cd ${SCRIPTPATH}/.. || exit
# Get the branch currently used
CURBRANCH=$(git rev-parse --abbrev-ref HEAD)
# Get latest updates to the repo
git fetch --all && \
git reset --hard origin/${CURBRANCH}
Expand Down

0 comments on commit 9052538

Please sign in to comment.