forked from xiaoxindada/SGSI-build-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·33 lines (29 loc) · 908 Bytes
/
update.sh
File metadata and controls
executable file
·33 lines (29 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
LOCALDIR=`cd "$( dirname $0 )" && pwd`
cd $LOCALDIR
if [ ! -d ".git" ];then
echo "检测到当前为使用git同步工具,是否为你强制使用git同步并更新?"
select update in "Update" "Exit" ;do
case $update in
"Update")
echo "正在强制使用git更新中,请准备好梯子"
git init
git checkout -B 12
git remote add origin https://github.com/xiaoxindada/SGSI-build-tool.git
git fetch https://github.com/xiaoxindada/SGSI-build-tool.git 12
git remote -v
git reset --hard FETCH_HEAD
git clean -df
git pull origin 12
git branch --set-upstream-to=origin/12
git submodule update --init --recursive
git pull --recurse-submodules
break;;
"Exit")
break;;
esac
done
exit
fi
git submodule update --init --recursive
git pull --recurse-submodules