|
821 | 821 |
|
822 | 822 | </li> |
823 | 823 |
|
824 | | - </ul> |
825 | | - </nav> |
826 | | - |
827 | | -</li> |
828 | | - |
829 | | - <li class="md-nav__item"> |
830 | | - <a href="#bump-version-to-200-even-when-theres-no-breaking-changes-or-even-no-commits" class="md-nav__link"> |
831 | | - <span class="md-ellipsis"> |
832 | | - |
833 | | - bump version to 2.0.0 even when there's no breaking changes or even no commits |
834 | | - |
835 | | - </span> |
836 | | - </a> |
837 | | - |
838 | | - <nav class="md-nav" aria-label="bump version to 2.0.0 even when there's no breaking changes or even no commits"> |
839 | | - <ul class="md-nav__list"> |
840 | | - |
841 | 824 | <li class="md-nav__item"> |
842 | 825 | <a href="#-tag-format" class="md-nav__link"> |
843 | 826 | <span class="md-ellipsis"> |
|
847 | 830 | </span> |
848 | 831 | </a> |
849 | 832 |
|
850 | | -</li> |
851 | | - |
852 | | - <li class="md-nav__item"> |
853 | | - <a href="#avoid-raising-errors" class="md-nav__link"> |
854 | | - <span class="md-ellipsis"> |
855 | | - |
856 | | - Avoid raising errors |
857 | | - |
858 | | - </span> |
859 | | - </a> |
860 | | - |
861 | | - <nav class="md-nav" aria-label="Avoid raising errors"> |
862 | | - <ul class="md-nav__list"> |
863 | | - |
864 | | - <li class="md-nav__item"> |
865 | | - <a href="#recommended-use-case" class="md-nav__link"> |
866 | | - <span class="md-ellipsis"> |
867 | | - |
868 | | - Recommended use case |
869 | | - |
870 | | - </span> |
871 | | - </a> |
872 | | - |
873 | | -</li> |
874 | | - |
875 | | - <li class="md-nav__item"> |
876 | | - <a href="#easy-way" class="md-nav__link"> |
877 | | - <span class="md-ellipsis"> |
878 | | - |
879 | | - Easy way |
880 | | - |
881 | | - </span> |
882 | | - </a> |
883 | | - |
884 | | -</li> |
885 | | - |
886 | | - <li class="md-nav__item"> |
887 | | - <a href="#longer-way" class="md-nav__link"> |
888 | | - <span class="md-ellipsis"> |
889 | | - |
890 | | - Longer way |
891 | | - |
892 | | - </span> |
893 | | - </a> |
894 | | - |
895 | | -</li> |
896 | | - |
897 | | - </ul> |
898 | | - </nav> |
899 | | - |
900 | 833 | </li> |
901 | 834 |
|
902 | 835 | </ul> |
|
2690 | 2623 |
|
2691 | 2624 | </li> |
2692 | 2625 |
|
2693 | | - </ul> |
2694 | | - </nav> |
2695 | | - |
2696 | | -</li> |
2697 | | - |
2698 | | - <li class="md-nav__item"> |
2699 | | - <a href="#bump-version-to-200-even-when-theres-no-breaking-changes-or-even-no-commits" class="md-nav__link"> |
2700 | | - <span class="md-ellipsis"> |
2701 | | - |
2702 | | - bump version to 2.0.0 even when there's no breaking changes or even no commits |
2703 | | - |
2704 | | - </span> |
2705 | | - </a> |
2706 | | - |
2707 | | - <nav class="md-nav" aria-label="bump version to 2.0.0 even when there's no breaking changes or even no commits"> |
2708 | | - <ul class="md-nav__list"> |
2709 | | - |
2710 | 2626 | <li class="md-nav__item"> |
2711 | 2627 | <a href="#-tag-format" class="md-nav__link"> |
2712 | 2628 | <span class="md-ellipsis"> |
|
2716 | 2632 | </span> |
2717 | 2633 | </a> |
2718 | 2634 |
|
2719 | | -</li> |
2720 | | - |
2721 | | - <li class="md-nav__item"> |
2722 | | - <a href="#avoid-raising-errors" class="md-nav__link"> |
2723 | | - <span class="md-ellipsis"> |
2724 | | - |
2725 | | - Avoid raising errors |
2726 | | - |
2727 | | - </span> |
2728 | | - </a> |
2729 | | - |
2730 | | - <nav class="md-nav" aria-label="Avoid raising errors"> |
2731 | | - <ul class="md-nav__list"> |
2732 | | - |
2733 | | - <li class="md-nav__item"> |
2734 | | - <a href="#recommended-use-case" class="md-nav__link"> |
2735 | | - <span class="md-ellipsis"> |
2736 | | - |
2737 | | - Recommended use case |
2738 | | - |
2739 | | - </span> |
2740 | | - </a> |
2741 | | - |
2742 | | -</li> |
2743 | | - |
2744 | | - <li class="md-nav__item"> |
2745 | | - <a href="#easy-way" class="md-nav__link"> |
2746 | | - <span class="md-ellipsis"> |
2747 | | - |
2748 | | - Easy way |
2749 | | - |
2750 | | - </span> |
2751 | | - </a> |
2752 | | - |
2753 | | -</li> |
2754 | | - |
2755 | | - <li class="md-nav__item"> |
2756 | | - <a href="#longer-way" class="md-nav__link"> |
2757 | | - <span class="md-ellipsis"> |
2758 | | - |
2759 | | - Longer way |
2760 | | - |
2761 | | - </span> |
2762 | | - </a> |
2763 | | - |
2764 | | -</li> |
2765 | | - |
2766 | | - </ul> |
2767 | | - </nav> |
2768 | | - |
2769 | 2635 | </li> |
2770 | 2636 |
|
2771 | 2637 | </ul> |
|
2790 | 2656 |
|
2791 | 2657 |
|
2792 | 2658 |
|
| 2659 | + <h1>bump</h1> |
| 2660 | + |
2793 | 2661 | <p><img alt="Bump version" src="../../images/bump.gif" /></p> |
2794 | 2662 | <h2 id="about">About<a class="headerlink" href="#about" title="Permanent link">¶</a></h2> |
2795 | 2663 | <p><code>cz bump</code> is a powerful command that <strong>automatically</strong> determines and increases your project's version number based on your commit history.</p> |
@@ -3205,30 +3073,27 @@ <h3 id="-get-next"><code>--get-next</code><a class="headerlink" href="#-get-next |
3205 | 3073 | <div class="admonition warning"> |
3206 | 3074 | <p class="admonition-title">Warning</p> |
3207 | 3075 | <p>The <code>--get-next</code> flag will raise a <code>NoneIncrementExit</code> if the found commits are not eligible for a version bump.</p> |
3208 | | -<p>For information on how to suppress this exit, see <a href="#avoid-raising-errors">avoid raising errors</a>.</p> |
| 3076 | +<p>For information on how to suppress this exit, see <a href="../../exit_codes/#ignoring-exit-codes">Ignoring Exit Codes</a>.</p> |
3209 | 3077 | </div> |
3210 | 3078 | <h3 id="-allow-no-commit"><code>--allow-no-commit</code><a class="headerlink" href="#-allow-no-commit" title="Permanent link">¶</a></h3> |
3211 | 3079 | <p>Allow the project version to be bumped even when there's no eligible version.</p> |
3212 | | -<div class="admonition note"> |
3213 | | -<p class="admonition-title">Example usage</p> |
3214 | | -<div class="highlight"><pre><span></span><code><span class="c1"># bump a minor version even when there's only bug fixes, documentation changes or even no commits</span> |
3215 | | - |
| 3080 | +<p>Example usage:</p> |
| 3081 | +<div class="highlight"><pre><span></span><code><span class="c1"># Force to bump a minor version</span> |
3216 | 3082 | cz<span class="w"> </span>bump<span class="w"> </span>--increment<span class="w"> </span>MINOR<span class="w"> </span>--allow-no-commit |
3217 | 3083 |
|
3218 | 3084 | <span class="c1"># bump version to 2.0.0 even when there's no breaking changes or even no commits</span> |
3219 | 3085 | cz<span class="w"> </span>bump<span class="w"> </span>--allow-no-commit<span class="w"> </span><span class="m">2</span>.0.0 |
3220 | 3086 | </code></pre></div> |
3221 | | -</div> |
3222 | 3087 | <div class="admonition note"> |
3223 | 3088 | <p class="admonition-title">Default increment</p> |
3224 | 3089 | <p>The increment is overridden to <code>PATCH</code> if there is no increment detected or specified.</p> |
3225 | 3090 | <p>In other words, <code>cz bump --allow-no-commit</code> allows you to bump the version to the next patch version even when there is no eligible commit.</p> |
3226 | 3091 | <div class="highlight"><pre><span></span><code><span class="c1"># will bump to `1.0.1` if the current version is `1.0.0`.</span> |
3227 | 3092 | cz<span class="w"> </span>bump<span class="w"> </span>--allow-no-commit |
| 3093 | + |
| 3094 | +<span class="c1"># bump version to 2.0.0 even when there's no breaking changes or even no commits</span> |
| 3095 | +cz<span class="w"> </span>bump<span class="w"> </span>--allow-no-commit<span class="w"> </span><span class="m">2</span>.0.0 |
3228 | 3096 | </code></pre></div> |
3229 | | -<h1 id="bump-version-to-200-even-when-theres-no-breaking-changes-or-even-no-commits">bump version to 2.0.0 even when there's no breaking changes or even no commits<a class="headerlink" href="#bump-version-to-200-even-when-theres-no-breaking-changes-or-even-no-commits" title="Permanent link">¶</a></h1> |
3230 | | -<p>cz bump --allow-no-commit 2.0.0 |
3231 | | -```</p> |
3232 | 3097 | </div> |
3233 | 3098 | <h3 id="-tag-format"><code>--tag-format</code><a class="headerlink" href="#-tag-format" title="Permanent link">¶</a></h3> |
3234 | 3099 | <p><code>tag_format</code> and [version_scheme][version_scheme] are combined to make Git tag names from versions.</p> |
@@ -3287,52 +3152,6 @@ <h3 id="-tag-format"><code>--tag-format</code><a class="headerlink" href="#-tag- |
3287 | 3152 | </tr> |
3288 | 3153 | </tbody> |
3289 | 3154 | </table> |
3290 | | -<h2 id="avoid-raising-errors">Avoid raising errors<a class="headerlink" href="#avoid-raising-errors" title="Permanent link">¶</a></h2> |
3291 | | -<p>Some situations from Commitizen raise an exit code different from 0. |
3292 | | -If the error code is different from 0, any CI or script running Commitizen might be interrupted.</p> |
3293 | | -<p>If you have a special use case, where you don't want to raise one of these error codes, you can |
3294 | | -tell Commitizen to not raise them.</p> |
3295 | | -<h3 id="recommended-use-case">Recommended use case<a class="headerlink" href="#recommended-use-case" title="Permanent link">¶</a></h3> |
3296 | | -<p>At the moment, we've identified that the most common error code to skip is</p> |
3297 | | -<table> |
3298 | | -<thead> |
3299 | | -<tr> |
3300 | | -<th>Error name</th> |
3301 | | -<th>Exit code</th> |
3302 | | -</tr> |
3303 | | -</thead> |
3304 | | -<tbody> |
3305 | | -<tr> |
3306 | | -<td>NoneIncrementExit</td> |
3307 | | -<td>21</td> |
3308 | | -</tr> |
3309 | | -</tbody> |
3310 | | -</table> |
3311 | | -<p>There are some situations where you don't want to get an error code when some |
3312 | | -commits do not match your rules, you just want those commits to be skipped.</p> |
3313 | | -<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>-nr<span class="w"> </span><span class="m">21</span><span class="w"> </span>bump |
3314 | | -</code></pre></div> |
3315 | | -<h3 id="easy-way">Easy way<a class="headerlink" href="#easy-way" title="Permanent link">¶</a></h3> |
3316 | | -<p>Check which error code was raised by Commitizen by running in the terminal</p> |
3317 | | -<div class="highlight"><pre><span></span><code><span class="nb">echo</span><span class="w"> </span><span class="nv">$?</span> |
3318 | | -</code></pre></div> |
3319 | | -<p>The output should be an integer like this</p> |
3320 | | -<div class="highlight"><pre><span></span><code><span class="m">3</span> |
3321 | | -</code></pre></div> |
3322 | | -<p>And then you can tell Commitizen to ignore it:</p> |
3323 | | -<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>--no-raise<span class="w"> </span><span class="m">3</span> |
3324 | | -</code></pre></div> |
3325 | | -<p>You can tell Commitizen to skip more than one if needed:</p> |
3326 | | -<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>--no-raise<span class="w"> </span><span class="m">3</span>,4,5 |
3327 | | -</code></pre></div> |
3328 | | -<h3 id="longer-way">Longer way<a class="headerlink" href="#longer-way" title="Permanent link">¶</a></h3> |
3329 | | -<p>Check the list of <a href="../../exit_codes/">exit_codes</a> and understand which one you have |
3330 | | -to skip and why.</p> |
3331 | | -<p>Remember to document somewhere this, because you'll forget.</p> |
3332 | | -<p>For example if the system raises a <code>NoneIncrementExit</code> error, you look it up |
3333 | | -on the list, and then you can use the exit code:</p> |
3334 | | -<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>-nr<span class="w"> </span><span class="m">21</span><span class="w"> </span>bump |
3335 | | -</code></pre></div> |
3336 | 3155 |
|
3337 | 3156 |
|
3338 | 3157 |
|
|
0 commit comments