Skip to content

Commit 50cebb9

Browse files
committed
docs(check): update --default-branch option
1 parent 3cc72e8 commit 50cebb9

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

docs/commands/check.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,37 @@ $ cz check --rev-range REV_RANGE
2727

2828
For example, if you'd like to check all commits on a branch, you can use `--rev-range master..HEAD`. Or, if you'd like to check all commits starting from when you first implemented commit message linting, you can use `--rev-range <first_commit_sha>..HEAD`.
2929

30+
You can also use `--default-range` to check all commits from the default branch up to HEAD. This is equivalent to using `--rev-range <default_branch>..HEAD`.
31+
3032
For more information on how git commit ranges work, you can check the [git documentation](https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#_commit_ranges).
3133

3234
### Commit Message
3335

3436
There are two ways you can provide your plain message and check it.
3537

36-
#### Method 1: use -m or --message
38+
#### Method 1: use `-m` or `--message`
3739

3840
```bash
3941
$ cz check --message MESSAGE
4042
```
4143

42-
In this option, MESSAGE is the commit message to be checked.
44+
In this option, `MESSAGE` is the commit message to be checked.
4345

4446
#### Method 2: use pipe to pipe it to `cz check`
4547

4648
```bash
4749
$ echo MESSAGE | cz check
4850
```
4951

50-
In this option, MESSAGE is piped to cz check and will be checked.
52+
In this option, MESSAGE is piped to `cz check` and will be checked.
5153

5254
### Commit Message File
5355

5456
```bash
5557
$ cz check --commit-msg-file COMMIT_MSG_FILE
5658
```
5759

58-
In this option, COMMIT_MSG_FILE is the path of the temporary file that contains the commit message.
60+
In this option, `COMMIT_MSG_FILE` is the path of the temporary file that contains the commit message.
5961
This argument can be useful when cooperating with git hooks. Please check [Automatically check message before commit](../tutorials/auto_check.md) for more information about how to use this argument with git hooks.
6062

6163
### Allow Abort
@@ -65,12 +67,18 @@ cz check --message MESSAGE --allow-abort
6567
```
6668

6769
Empty commit messages typically instruct Git to abort a commit, so you can pass `--allow-abort` to
68-
permit them. Since `git commit` accepts an `--allow-empty-message` flag (primarily for wrapper scripts), you may wish to disallow such commits in CI. `--allow-abort` may be used in conjunction with any of the other options.
70+
permit them. Since `git commit` accepts the `--allow-empty-message` flag (primarily for wrapper scripts), you may wish to disallow such commits in CI. `--allow-abort` may be used in conjunction with any of the other options.
6971

7072
### Allowed Prefixes
7173

7274
If the commit message starts with some specific prefixes, `cz check` returns `True` without checking the regex.
73-
By default, the following prefixes are allowed: `Merge`, `Revert`, `Pull request`, `fixup!` and `squash!`.
75+
By default, the following prefixes are allowed:
76+
77+
- `Merge`
78+
- `Revert`
79+
- `Pull request`
80+
- `fixup!`
81+
- `squash!`
7482

7583
```bash
7684
cz check --message MESSAGE --allowed-prefixes 'Merge' 'Revert' 'Custom Prefix'
@@ -83,5 +91,5 @@ For example, `cz check --message MESSAGE -l 3` would fail the check, since `MESS
8391
By default, the limit is set to 0, which means no limit on the length.
8492

8593
**Note that the limit applies only to the first line of the message.**
86-
Specifically, for `ConventionalCommitsCz` the length only counts from the type of change to the subject,
87-
while the body and the footer are not counted.
94+
95+
Specifically, for `ConventionalCommitsCz` the length only counts from the type of change to the subject, while the body and the footer are not counted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy