diff --git a/dbg.clone b/dbg.clone index b0487ec..cdbd3f3 100755 --- a/dbg.clone +++ b/dbg.clone @@ -3,6 +3,7 @@ SDIR=$(cd "$(dirname "$0")" ; pwd -P) DST_DIR=/Users/mk/test-dist REPO_URL=https://github.com/kornerr/ru +TMP_BRANCHES=/tmp/dbg-branches # Clone since the directory does not exist if [ ! -d "$DST_DIR" ]; then @@ -13,10 +14,9 @@ fi cd $DST_DIR git pull -# Find out the latest branch -git branch -r --sort=-committerdate | head -n2 -branch=`git branch -r --sort=-committerdate | head -n2` -echo $branch +# Find out the latest commit in the whole repo +cmt=`git branch -av --sort=-committerdate | head -n1 | cut -d' ' -f4` +echo "Latest commit: $cmt" # Switch to the latest branch -#git checkout $branch +git checkout $cmt