File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,16 @@ echo -e "${YELLOW}📋 当前分支: $CURRENT_BRANCH${NC}"
2020
2121if [ " $CURRENT_BRANCH " = " main" ]; then
2222 echo -e " ${RED} ❌ 错误:不能在 main 分支直接提交代码${NC} "
23- echo -e " ${YELLOW} 💡 请创建功能分支:git checkout -b [###-task -description]${NC} "
23+ echo -e " ${YELLOW} 💡 请创建功能分支:git checkout -b [feature-bugfix -description]${NC} "
2424 exit 1
2525fi
2626
2727# 2. 检查分支命名规范
28- if [[ ! " $CURRENT_BRANCH " =~ ^[0-9 ]+-. +$ ]]; then
29- echo -e " ${YELLOW} ⚠️ 警告:分支名称建议遵循 [###-task -description] 格式${NC} "
28+ if [[ ! " $CURRENT_BRANCH " =~ ^[a-z0-9- ]+-[a-z0-9-] +$ ]]; then
29+ echo -e " ${YELLOW} ⚠️ 警告:分支名称建议遵循 [feature-bugfix -description] 格式${NC} "
3030 echo -e " ${YELLOW} 当前分支: $CURRENT_BRANCH ${NC} "
31- echo -e " ${YELLOW} 建议格式: 123-feature-description${NC} "
31+ echo -e " ${YELLOW} 建议格式: feature-description 或 bug-fix-description${NC} "
32+ echo -e " ${YELLOW} 示例: feature-user-authentication, docs-update-guide${NC} "
3233
3334 read -p " 是否继续提交?(y/N): " -n 1 -r
3435 echo
Original file line number Diff line number Diff line change 1+ test content
You can’t perform that action at this time.
0 commit comments