diff --git a/compile.sh b/compile.sh index 74932d8..61ad53b 100755 --- a/compile.sh +++ b/compile.sh @@ -24,9 +24,20 @@ if [ -n "$(git status --porcelain)" ]; then exit 1 fi +# 获取最新的远程分支信息 +echo "正在获取最新的远程分支信息..." | tee -a $LOGFILE +git fetch origin + # 检查远程分支是否和本地分支一致 -if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/dev)" ]; then - echo "本地分支和远程分支不一致" +local_commit=$(git rev-parse HEAD) +remote_commit=$(git rev-parse origin/dev) +if [ "$local_commit" != "$remote_commit" ]; then + echo "本地分支和远程分支不一致" | tee -a $LOGFILE + echo "本地分支: $local_commit" | tee -a $LOGFILE + echo "远程分支: $remote_commit" | tee -a $LOGFILE + echo "请运行以下命令之一来解决:" | tee -a $LOGFILE + echo " git pull origin dev # 如果远程有新提交" | tee -a $LOGFILE + echo " git push origin dev # 如果本地有新提交" | tee -a $LOGFILE exit 1 fi diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index 3e987fe..955fd14 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -230,7 +230,7 @@ export default function WorkFlow() { )} -