Commit 302fa73a authored by QA-甘 盛聪's avatar QA-甘 盛聪
parents 75d3e40d feaddcea
......@@ -18,15 +18,15 @@ if [ -n "$project_folder" ];then
sh $config_server/show_info.sh $project_name pull代码 $desc $3
cd ./$project_name
git checkout ./
git fetch
git reset --hard
git fetch -p
#git pull
if [ -n "$git_branch" ]; then
echo "checkout specified branch $git_branch"
git checkout -f $git_branch
if [ $? = 0 ]; then
echo "checkout branch $git_branch is ok".
git pull
# git pull
else
echo "Fail to checkout branch $git_branch".
exit -1
......@@ -36,8 +36,11 @@ if [ -n "$project_folder" ];then
#git checkout -f master
git_branch=`git branch | grep '*' | awk '{print $2}'`
echo "current branch: $git_branch"
git pull
# git pull
fi
git fetch -p
echo "git reset FETCH_HEAD --hard"
git reset FETCH_HEAD --hard
else
desc=`node $config_server/get_project_config.js -name $project_name -attr desc`
sh $config_server/show_info.sh $project_name clone代码 $desc $3
......
......@@ -24,14 +24,13 @@ function getCode()
echo "sh $config_server/show_info.sh $project pull代码 $desc $3"
sh $config_server/show_info.sh $project pull代码 $desc $3
cd ./$project
echo "git reset --hard"
git reset --hard
echo "git checkout ./"
git checkout ./
echo "git fetch"
git fetch
echo "git pull"
git pull
# echo "git pull"
# git pull
#如果拉代码失败,则获取现在所处分支,然后删掉现在的项目,重新clone
if [ $? -ne 0 ]; then
echo "error: Pulling is not possible because you have unmerged files"
......@@ -50,6 +49,8 @@ function getCode()
git_branch=$2
fi
git pull
echo "git reset FETCH_HEAD --hard"
git reset FETCH_HEAD --hard
git branch
else
sh $config_server/show_info.sh $project clone代码 $desc $3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment