|
374 | 374 | </span> |
375 | 375 | </a> |
376 | 376 |
|
| 377 | +</li> |
| 378 | + |
| 379 | + <li class="md-nav__item"> |
| 380 | + <a href="#command" class="md-nav__link"> |
| 381 | + <span class="md-ellipsis"> |
| 382 | + Command |
| 383 | + </span> |
| 384 | + </a> |
| 385 | + |
| 386 | +</li> |
| 387 | + |
| 388 | + <li class="md-nav__item"> |
| 389 | + <a href="#interactive-configuration" class="md-nav__link"> |
| 390 | + <span class="md-ellipsis"> |
| 391 | + Interactive Configuration |
| 392 | + </span> |
| 393 | + </a> |
| 394 | + |
| 395 | +</li> |
| 396 | + |
| 397 | + <li class="md-nav__item"> |
| 398 | + <a href="#configuration-file" class="md-nav__link"> |
| 399 | + <span class="md-ellipsis"> |
| 400 | + Configuration File |
| 401 | + </span> |
| 402 | + </a> |
| 403 | + |
| 404 | +</li> |
| 405 | + |
| 406 | + <li class="md-nav__item"> |
| 407 | + <a href="#configuration-options" class="md-nav__link"> |
| 408 | + <span class="md-ellipsis"> |
| 409 | + Configuration Options |
| 410 | + </span> |
| 411 | + </a> |
| 412 | + |
377 | 413 | </li> |
378 | 414 |
|
379 | 415 | <li class="md-nav__item"> |
|
383 | 419 | </span> |
384 | 420 | </a> |
385 | 421 |
|
| 422 | +</li> |
| 423 | + |
| 424 | + <li class="md-nav__item"> |
| 425 | + <a href="#next-steps" class="md-nav__link"> |
| 426 | + <span class="md-ellipsis"> |
| 427 | + Next Steps |
| 428 | + </span> |
| 429 | + </a> |
| 430 | + |
386 | 431 | </li> |
387 | 432 |
|
388 | 433 | </ul> |
|
781 | 826 |
|
782 | 827 |
|
783 | 828 | <span class="md-ellipsis"> |
784 | | - Github Actions |
| 829 | + GitHub Actions |
785 | 830 | </span> |
786 | 831 |
|
787 | 832 |
|
|
992 | 1037 | </span> |
993 | 1038 | </a> |
994 | 1039 |
|
| 1040 | +</li> |
| 1041 | + |
| 1042 | + <li class="md-nav__item"> |
| 1043 | + <a href="#command" class="md-nav__link"> |
| 1044 | + <span class="md-ellipsis"> |
| 1045 | + Command |
| 1046 | + </span> |
| 1047 | + </a> |
| 1048 | + |
| 1049 | +</li> |
| 1050 | + |
| 1051 | + <li class="md-nav__item"> |
| 1052 | + <a href="#interactive-configuration" class="md-nav__link"> |
| 1053 | + <span class="md-ellipsis"> |
| 1054 | + Interactive Configuration |
| 1055 | + </span> |
| 1056 | + </a> |
| 1057 | + |
| 1058 | +</li> |
| 1059 | + |
| 1060 | + <li class="md-nav__item"> |
| 1061 | + <a href="#configuration-file" class="md-nav__link"> |
| 1062 | + <span class="md-ellipsis"> |
| 1063 | + Configuration File |
| 1064 | + </span> |
| 1065 | + </a> |
| 1066 | + |
| 1067 | +</li> |
| 1068 | + |
| 1069 | + <li class="md-nav__item"> |
| 1070 | + <a href="#configuration-options" class="md-nav__link"> |
| 1071 | + <span class="md-ellipsis"> |
| 1072 | + Configuration Options |
| 1073 | + </span> |
| 1074 | + </a> |
| 1075 | + |
995 | 1076 | </li> |
996 | 1077 |
|
997 | 1078 | <li class="md-nav__item"> |
|
1001 | 1082 | </span> |
1002 | 1083 | </a> |
1003 | 1084 |
|
| 1085 | +</li> |
| 1086 | + |
| 1087 | + <li class="md-nav__item"> |
| 1088 | + <a href="#next-steps" class="md-nav__link"> |
| 1089 | + <span class="md-ellipsis"> |
| 1090 | + Next Steps |
| 1091 | + </span> |
| 1092 | + </a> |
| 1093 | + |
1004 | 1094 | </li> |
1005 | 1095 |
|
1006 | 1096 | </ul> |
|
1020 | 1110 |
|
1021 | 1111 | <h1>init</h1> |
1022 | 1112 |
|
| 1113 | +<p>The <code>cz init</code> command helps you set up Commitizen in your project by creating a configuration file with your preferred settings.</p> |
1023 | 1114 | <h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link">¶</a></h2> |
1024 | 1115 | <p><img alt="cz init --help" src="../../images/cli_help/cz_init___help.svg" /></p> |
1025 | | -<h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h2> |
1026 | | -<p>To start using Commitizen, the recommended approach is to run</p> |
| 1116 | +<h2 id="command">Command<a class="headerlink" href="#command" title="Permanent link">¶</a></h2> |
1027 | 1117 | <div class="highlight"><pre><span></span><code>cz<span class="w"> </span>init |
1028 | 1118 | </code></pre></div> |
| 1119 | +<h2 id="interactive-configuration">Interactive Configuration<a class="headerlink" href="#interactive-configuration" title="Permanent link">¶</a></h2> |
| 1120 | +<p>When you run <code>cz init</code>, Commitizen will guide you through an interactive setup process:</p> |
1029 | 1121 | <p><img alt="init" src="../../images/init.gif" /></p> |
1030 | | -<p>This command will ask you for information about the project and will |
1031 | | -configure the selected file type (<code>pyproject.toml</code>, <code>.cz.toml</code>, etc.).</p> |
1032 | | -<p>The <code>init</code> will help you with</p> |
| 1122 | +<h2 id="configuration-file">Configuration File<a class="headerlink" href="#configuration-file" title="Permanent link">¶</a></h2> |
| 1123 | +<p>The initialization process will create a configuration file in your project root.</p> |
| 1124 | +<p>Choose the configuration file format based on your project type:</p> |
| 1125 | +<ul> |
| 1126 | +<li>Use <code>pyproject.toml</code> for Python projects</li> |
| 1127 | +<li>Use <code>.cz.toml</code>, <code>.cz.yaml</code>, <code>.cz.json</code>, etc. for other projects.</li> |
| 1128 | +</ul> |
| 1129 | +<h2 id="configuration-options">Configuration Options<a class="headerlink" href="#configuration-options" title="Permanent link">¶</a></h2> |
| 1130 | +<p>During the initialization process, you'll be prompted to configure the following settings:</p> |
| 1131 | +<ol> |
| 1132 | +<li><strong>Convention Rules</strong>: Select the commit message convention to follow (e.g., conventional commits)</li> |
| 1133 | +<li><strong>Version Provider</strong>: Choose how to manage versioning in your project. Commitizen supports multiple version management systems:<ul> |
| 1134 | +<li><code>commitizen</code>: Uses Commitizen's built-in version management system</li> |
| 1135 | +<li><code>npm</code>: Manages version in <code>package.json</code> for Node.js projects</li> |
| 1136 | +<li><code>cargo</code>: Manages version in <code>Cargo.toml</code> for Rust projects</li> |
| 1137 | +<li><code>composer</code>: Manages version in <code>composer.json</code> for PHP projects</li> |
| 1138 | +<li><code>pep621</code>: Uses <code>pyproject.toml</code> with PEP 621 standard</li> |
| 1139 | +<li><code>poetry</code>: Uses <code>pyproject.toml</code> with Poetry configuration</li> |
| 1140 | +<li><code>uv</code>: Uses <code>pyproject.toml</code> and <code>uv.lock</code> for Python projects</li> |
| 1141 | +<li><code>scm</code>: Reads version directly from git tags without modifying files</li> |
| 1142 | +</ul> |
| 1143 | +</li> |
| 1144 | +<li><strong>Project Version</strong>: The current version of your project will be detected automatically</li> |
| 1145 | +<li><strong>Tag Format</strong>: The format used for version tags in your repository</li> |
| 1146 | +<li><strong>Version Type</strong>: Choose between:<ul> |
| 1147 | +<li><code>semver</code> or <code>semver2</code>: Semantic Versioning (MAJOR.MINOR.PATCH)</li> |
| 1148 | +<li><code>pep440</code>: Python Package Versioning</li> |
| 1149 | +</ul> |
| 1150 | +</li> |
| 1151 | +<li><strong>Changelog Generation</strong>: Configure whether to automatically generate changelog during version bumps</li> |
| 1152 | +<li><strong>Alpha Versioning</strong>: Option to keep major version at 0 for alpha/beta software</li> |
| 1153 | +<li><strong>Pre-commit Hooks</strong>: Set up Git pre-commit hooks for automated commit message validation</li> |
| 1154 | +</ol> |
| 1155 | +<h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h2> |
| 1156 | +<div class="highlight"><pre><span></span><code><span class="c1"># Start the initialization process</span> |
| 1157 | +cz<span class="w"> </span>init |
| 1158 | + |
| 1159 | +<span class="c1"># Follow the interactive prompts to configure your project</span> |
| 1160 | +</code></pre></div> |
| 1161 | +<h2 id="next-steps">Next Steps<a class="headerlink" href="#next-steps" title="Permanent link">¶</a></h2> |
| 1162 | +<p>After initialization, you can:</p> |
1033 | 1163 | <ol> |
1034 | | -<li>Choose a convention rules (<code>name</code>)</li> |
1035 | | -<li>Choosing a version provider (<code>commitizen</code> or for example <code>Cargo.toml</code>)</li> |
1036 | | -<li>Detecting your project's version</li> |
1037 | | -<li>Detecting the tag format used</li> |
1038 | | -<li>Choosing a version type (<code>semver</code> or <code>pep440</code>)</li> |
1039 | | -<li>Whether to create the changelog automatically or not during bump</li> |
1040 | | -<li>Whether you want to keep the major as zero while building alpha software.</li> |
1041 | | -<li>Whether to setup pre-commit hooks.</li> |
| 1164 | +<li>Start using <code>cz commit</code> to create conventional commits</li> |
| 1165 | +<li>Use <code>cz bump</code> to manage versioning</li> |
| 1166 | +<li>Configure additional settings in your project's configuration file</li> |
1042 | 1167 | </ol> |
1043 | 1168 |
|
1044 | 1169 |
|
|
0 commit comments