Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
- 合并 note-* 分支的 PR 时,一律采用 merge 的方式合并!如果需要 squash,请本地的 note-* 分支上处理,一旦提交到云端,则无法进行 squash,如果非要压缩,则需要修改分支保护策略。

> [!TIP]
> - 克隆指定分支/标签: `git clone -b <name> <url> <folder-name>`
>
> - 新建分支流程:
> 新建分支流程:
> 1. 先克隆锚点
> ```sh
> $ git clone -b anchor-new-branch https://github.com/Linhieng/note.git note-xxx
> # 先克隆锚点
>
> $ cd note-xxx
> # 进入克隆后的文件夹中
>
> $ git switch -c note-xxx
> # 新建分支
>
> $ mkdir xxx
> # 新建一个文件夹,此时不需要 note- 前缀!
>
> # 现在,我们的本地仓库文件夹、仓库中的新分支对应文件夹,
> # 新的分支名就都有了。
> # 并且其中的分支名和本地仓库文件夹名称是一致的,
> # 但仓库中的文件夹名称则没有 note- 前缀!
> git clone -b anchor-new-branch https://github.com/Linhieng/note.git note-xxx
> ```
> 2. 然后进入克隆后的文件夹中
> ```sh
> cd note-xxx
> ```
> 3. 新建分支
> ```sh
> git switch -c note-xxx
> ```
> 3. 新建一个文件夹,此时不需要 note- 前缀!
> ```sh
> mkdir xxx
> ```
> 现在,我们的本地仓库文件夹、仓库中的新分支对应文件夹,
> 新的分支名就都有了。
> 并且其中的分支名和本地仓库文件夹名称是一致的,
> 但仓库中的文件夹名称则没有 note- 前缀!