Skip to content

Commit

Permalink
Merge pull request #56 from WGrape/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
WGrape authored Sep 16, 2022
2 parents 1da1ba2 + aaafc3b commit 8a3ad4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ PR的提交不限制范围,如代码、文档等修改均在允许范围内,
- chore: 构建过程或辅助工具的变动,如dockerfile的修改

### <span id="43">(3) 分支管理</span>
代码统一先提交合至```test```分支,在review通过后,会根据实际情况选择合入```main```分支或者```release```分支。如果是非重要修改,则只会合入```main```分支。
代码统一先提交合至```test```分支,在review通过后合入```main```分支。

- ```main``` :主分支
- ```test``` :测试分支
- ```release```版本发布专用分支,合入```release```分支后会自动打包发布release
- ```release-please--branches--main--components--posture```版本自动发布专用分支,合入```main```分支后会自动打包发布release

### <span id="43">(4) 提交内容注释</span>
对于重要代码部分,请以评论的方式写清楚原因,可以参考 [fix: 修复push钩子中对特定分支名截取的bug](https://github.com/WGrape/posture/pull/23#pullrequestreview-1110452197)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- release
- main

name: Release

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ posture sethook
```

### <span id="321">(1) checkout钩子</span>
当使用```git checkout```命令时,会自动执行checkout钩子,如下图所示。
当使用```git checkout/git switch```命令时,会自动执行checkout钩子,如下图所示。

<details>
<summary>查看使用示例</summary>
<img width="680" alt="image" src="https://user-images.githubusercontent.com/35942268/189962874-9c6a3bba-d573-41a2-af3e-3594d4be2297.png">
<img width="680" alt="image" src="https://user-images.githubusercontent.com/35942268/190693301-44347c94-2c4f-4d8a-bfcc-2b917ae2d41f.png">
</details>

### <span id="322">(2) pull钩子</span>
Expand Down
6 changes: 6 additions & 0 deletions hooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ fi

printLogo
echo "温馨提示: 请及时拉取分支的最新代码 (Warm tips: Please pull the latest code in time)"

newBranch=$(git reflog | awk 'NR==1{ print $8; }')
echo "> 当前分支: \033[33m${newBranch}\033[0m"

changeDirection=$(git reflog | awk 'NR==1{ print $6 " -> " $8; exit }')
echo "> 分支切换顺序 (the direction of branch switch): \033[33m${changeDirection}\033[0m"

0 comments on commit 8a3ad4b

Please sign in to comment.