Skip to content

Commit b782fb6

Browse files
committed
2 parents 85a4c04 + daf4af0 commit b782fb6

1 file changed

Lines changed: 26 additions & 15 deletions

File tree

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ A custom Commitizen adapter/config for creating standardized commit messages wit
44

55
<small>This stuff makes it look like you know what you're doing, dawg. 👀</small>
66

7+
![t-rec](https://github.com/remcostoeten/custom-commitizen-adapter/assets/57683378/7fdbcd55-20b8-43b3-b995-41c70545d934)
8+
9+
```clis
10+
commit a401633a9362c3940c447daeaebaf264582da0f7
11+
Author: Remco Stoeten <remcostoeten@hotmail.com>
12+
Date: Sat Jun 8 06:54:43 2024 +0200
13+
chore: This video is such a chore man....
14+
```
15+
16+
17+
718
## Installation
819

920
Since it's an adapter for Commitizen, you need to have Commitizen installed globally:
1021

11-
@@@
22+
```bash
1223

1324
# Install Commitizen globally
1425

@@ -17,23 +28,23 @@ npm install -g commitizen
1728
# Install this package globally
1829

1930
npm install -g cleaner-commitizen-adapter
20-
@@@
31+
```
2132

2233
Commitizen does not support custom configuration via their own config file. To use this adapter you need to create a `.czrc` file in your home directory and set the path to the adapter. Edit/create the file with `vim ~/.czrc` and add the following line: `{ "path": "cleaner-commitizen-adapter" }`. This will tell Commitizen to use the custom adapter.
2334

2435
Alternatively, you can run the following command to create the file with the correct content in one go:
2536

26-
@@@
37+
```bash
2738
echo '{ "path": "cleaner-commitizen-adapter" }' > ~/.czrc
28-
@@@
39+
```
2940

3041
## Usage
3142

3243
To use this adapter with Commitizen, run:
3344

34-
@@@
45+
```bash
3546
cz
36-
@@@
47+
```
3748

3849
Answer the prompts to generate a standardized commit message.
3950

@@ -57,32 +68,32 @@ If you find the `cz` command annoying or having to `git add`, or push prior to r
5768

5869
1. Open `.zshrc` <small>Or `.bashrc` if you're using bash</small>:
5970

60-
@@@
71+
```bash
6172
vim ~/.zshrc
62-
@@@
73+
```
6374

6475
2. Add alias:
6576

66-
@@@
77+
```bash
6778
alias commit='cz'
68-
@@@
79+
```
6980

7081
Now, you can use the alias `commit` to quickly run the CLI tool. This allows you to type `commit` which could be more intuitive than `cz`.
7182

7283
Another one which I personally use, but must be used with caution due to the adding everything and pushing instantly is:
7384

74-
@@@
85+
```bash
7586
alias push='git add . && cz && git push'
76-
@@@
87+
```
7788

7889
A safe way to use this, but which is a little bit more time-consuming is to use the following alias:
7990

80-
@@@
91+
```bash
8192
alias push='git add . && cz && echo "You are about to push $(git diff --cached --numstat | wc -l) files." && echo "Are you sure you want to push these changes? (y/n/c) [Yes/No - commit only/No - abort all]" && read ans && if [[$ans = "y"]]; then git push; elif [[$ans = "n"]]; then echo "Changes committed, but not pushed."; else echo "Operation aborted."; git reset HEAD~; fi'
82-
@@@
93+
```
8394

8495
This will ask you after the commit if you want to continue with X files or not, giving you the option to push, quit, or only commit.
8596

8697
xxx love y'all,
8798

88-
Remco Stoeten
99+
[Remco Stoeten](https://remcostoeten.com)

0 commit comments

Comments
 (0)