before latest committer cmd
This commit is contained in:
22
dbg.clone
Executable file
22
dbg.clone
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
||||
|
||||
DST_DIR=/Users/mk/test-dist
|
||||
REPO_URL=https://github.com/kornerr/ru
|
||||
|
||||
# Clone since the directory does not exist
|
||||
if [ ! -d "$DST_DIR" ]; then
|
||||
git clone $REPO_URL $DST_DIR
|
||||
fi
|
||||
|
||||
# Pull the latest changes
|
||||
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
|
||||
|
||||
# Switch to the latest branch
|
||||
#git checkout $branch
|
||||
Reference in New Issue
Block a user