From 8a74c52a9d750dde97e50432d3907f0847b5058f Mon Sep 17 00:00:00 2001 From: Chopper Date: Mon, 24 May 2021 15:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A8=E9=80=81=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pushGithub.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pushGithub.sh b/pushGithub.sh index 7f6c27e60..d229a2a4f 100644 --- a/pushGithub.sh +++ b/pushGithub.sh @@ -1,17 +1,19 @@ -echo '开始推送github' -echo '切换git地址' +git remote rm origin +git remote add origin 'git@github.com:hongyehuicheng/lilishop.git' +git pull remote master +git push origin master --force +if [ "$?" = "0" ] +then +echo -e "\033[42;34m push to github success! \033[0m" +else +echo -e "\033[41;30m push to github fail! \033[0m" +exit 1 +fi + git remote rm origin -git remote add origin git@github.com:hongyehuicheng/lilishop.git -echo '设置上传代码分支,推送github' -git push --set-upstream origin master -echo '推送github完成' -git remote rm origin +git remote add origin 'git@gitee.com:beijing_hongye_huicheng/lilishop.git' -git remote add origin git@gitee.com:beijing_hongye_huicheng/lilishop.git -echo '切回gitee资源' -git branch --set-upstream-to=origin/master master -echo '设置git跟踪资源' -sleep 1 -echo '更新代码' -git pull +git pull remote master + +git branch --set-upstream-to=origin/master master \ No newline at end of file