-
Notifications
You must be signed in to change notification settings - Fork 0
/
conventional-commits.html
18 lines (17 loc) · 12.3 KB
/
conventional-commits.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html><html lang="de-ch"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Conventional commits - Finecloud</title><meta name="description" content="What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…"><meta name="generator" content="Publii Open-Source CMS for Static Site"><link rel="stylesheet" href="https://www.finecloud.ch/media/plugins/syntaxHighlighter/prism-black.css"><link rel="canonical" href="https://www.finecloud.ch/conventional-commits.html"><link rel="alternate" type="application/atom+xml" href="https://www.finecloud.ch/feed.xml"><link rel="alternate" type="application/json" href="https://www.finecloud.ch/feed.json"><meta property="og:title" content="Conventional commits"><meta property="og:site_name" content="Finecloud"><meta property="og:description" content="What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…"><meta property="og:url" content="https://www.finecloud.ch/conventional-commits.html"><meta property="og:type" content="article"><link rel="shortcut icon" href="https://www.finecloud.ch/media/website/finecloud.png" type="image/png"><link rel="stylesheet" href="https://www.finecloud.ch/assets/css/style.css?v=39da73365516a098a9b73b721fc970e2"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.finecloud.ch/conventional-commits.html"},"headline":"Conventional commits","datePublished":"2023-02-14T09:20","dateModified":"2023-02-14T09:20","description":"What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…","author":{"@type":"Person","name":"Finecloud","url":"https://www.finecloud.ch/authors/finecloud/"},"publisher":{"@type":"Organization","name":"Finecloud"}}</script><meta name="google-site-verification" content="seFY9U12uiEq5U3_MyZiX6XWzk0AVFl9zITr2ZKsytY"></head><body><div class="site-container"><header class="top" id="js-header"><a class="logo" href="https://www.finecloud.ch/">Finecloud</a><nav class="navbar js-navbar"><button class="navbar__toggle js-toggle" aria-label="Menu" aria-haspopup="true" aria-expanded="false"><span class="navbar__toggle-box"><span class="navbar__toggle-inner">Menu</span></span></button><ul class="navbar__menu"><li><a href="https://www.finecloud.ch/" target="_self">Blog</a></li><li><a href="https://www.finecloud.ch/tags/" target="_self">Tags</a></li></ul></nav><div class="search"><div class="search__overlay js-search-overlay"><div class="search__overlay-inner"><form action="https://www.finecloud.ch/search.html" class="search__form"><input class="search__input js-search-input" type="search" name="q" placeholder="search..." aria-label="search..." autofocus="autofocus"></form><button class="search__close js-search-close" aria-label="Close">Close</button></div></div><button class="search__btn js-search-btn" aria-label="Search"><svg role="presentation" focusable="false"><use xlink:href="https://www.finecloud.ch/assets/svg/svg-map.svg#search"/></svg></button></div></header><main><article class="post"><div class="hero"><figure class="hero__image hero__image--overlay"><img src="https://www.finecloud.ch/media/website/download.jpg" srcset="https://www.finecloud.ch/media/website/responsive/download-xs.jpg 300w, https://www.finecloud.ch/media/website/responsive/download-sm.jpg 480w, https://www.finecloud.ch/media/website/responsive/download-md.jpg 768w, https://www.finecloud.ch/media/website/responsive/download-lg.jpg 1024w, https://www.finecloud.ch/media/website/responsive/download-xl.jpg 1360w, https://www.finecloud.ch/media/website/responsive/download-2xl.jpg 1600w" sizes="100vw" loading="eager" alt=""></figure><header class="hero__content"><div class="wrapper"><div class="post__meta"><time datetime="2023-02-14T09:20">Februar 14, 2023</time></div><h1>Conventional commits</h1></div></header></div><div class="wrapper post__entry"><div class="post__toc"><h3>Table of Contents</h3><ul><li><a href="#mcetoc_1gp7g3b0bbq">What are Conventional commits</a></li><li><a href="#mcetoc_1gp7g3b0bbr">Why should you use Conventional commits</a></li><li><a href="#mcetoc_1gp7g3b0bbs">Example</a><ul><li><a href="#mcetoc_1gp7g3b0bbt">multiline commit messages</a></li></ul></li></ul></div><h2 id="mcetoc_1gp7g3b0bbq">What are Conventional commits</h2><p>Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand the changes made to a codebase over time.</p><p><a href="https://www.conventionalcommits.org/en/v1.0.0/#specification">https://www.conventionalcommits.org/en/v1.0.0/#specification</a></p><h2 id="mcetoc_1gp7g3b0bbr">Why should you use Conventional commits</h2><ul><li>Improving collaboration: Having a clear, concise and standardized way of writing commit messages helps everyone on the team understand what changes were made and why. This can improve collaboration and reduce the time spent discussing changes.</li><li>Better automated versioning: Conventional Commits provides a way to automate versioning and release management by using the commit messages to determine the type and scope of changes. This can save time and improve accuracy compared to manually managing versions.</li><li>Improved documentation: Commit messages can serve as a form of documentation, providing insight into the motivations and thought process behind changes. By using Conventional Commits, this documentation is more consistent and easier to understand.</li></ul><h2 id="mcetoc_1gp7g3b0bbs">Example</h2><p>Here's an example of a Conventional Commit message:<br><br><code>feat(parser): add ability to parse hexadecimal numbers</code><br><br><code>This commit adds the ability to parse hexadecimal numbers, allowing for a wider range of input options.</code><br><br>In this example, "feat" is the type of change being made (a new feature), "parser" is the scope of the change (the parser component), and the rest of the message provides a brief description of the change. The Conventional Commits specification defines a number of different types (e.g. "feat", "fix", "docs") and provides guidelines for how to use them.</p><h3 id="mcetoc_1gp7g3b0bbt">multiline commit messages</h3><p>how do you make multiline commit messages like these? how do you add an optional body or optional footer in a conventional Commit message?<br><br>Multiline commit messages are written by adding a blank line between the subject (first line) and the body (or footer). The subject should be a single line of text that summarizes the change and should not exceed 50 characters. If a more detailed explanation is needed, it can be added in the body.<br><br>Here's an example of a multiline Conventional Commit message:<br><br><code>feat(parser): add ability to parse hexadecimal numbers</code><br><br><code>This commit adds the ability to parse hexadecimal numbers, allowing for a wider range of input options. The new feature has been thoroughly tested and is now ready for use.</code><br><br>An optional footer can also be added to Conventional Commit messages for extra information, such as breaking changes, references to related issues, or other meta-information. The footer should start with a new line and should be separated from the body by a double line break. Here's an example with a footer:<br><br><code>feat(parser): add ability to parse hexadecimal numbers</code><br><br><code>This commit adds the ability to parse hexadecimal numbers, allowing for a wider range of input options. The new feature has been thoroughly tested and is now ready for use.</code><br><br><code>BREAKING CHANGE: The previous version of the parser only supported decimal numbers, so this change may break compatibility with existing code that uses the parser.</code><br><br>It's worth noting that not all Conventional Commit tools and systems require or make use of the body or footer. The most important aspect is the subject line, as it provides a concise summary of the change. The body and footer are optional and should be used as needed to provide additional context and information.<br><br>Here's an example of a Conventional Commit message with a body and footer, using the git commit command with the -m option:<br><br><code>$ git commit -m "feat(parser): add ability to parse hexadecimal numbers</code><br><br><code>This commit adds the ability to parse hexadecimal numbers, allowing for a wider range of input options. The new feature has been thoroughly tested and is now ready for use.</code><br><br><code>BREAKING CHANGE: The previous version of the parser only supported decimal numbers, so this change may break compatibility with existing code that uses the parser.</code><br><br><code>Closes #123"</code><br><br>In this example, the subject is "feat(parser): add ability to parse hexadecimal numbers", the body is "This commit adds the ability to parse hexadecimal numbers, allowing for a wider range of input options. The new feature has been thoroughly tested and is now ready for use.", and the footer is "BREAKING CHANGE: The previous version of the parser only supported decimal numbers, so this change may break compatibility with existing code that uses the parser. Closes #123". The "Closes #123" part of the footer is an example of a reference to a related issue, indicating that this commit resolves the issue with the given number.</p></div><footer class="wrapper post__footer"><p class="post__last-updated">This article was updated on Februar 14, 2023</p><ul class="post__tag"><li><a href="https://www.finecloud.ch/tags/git/">git</a></li><li><a href="https://www.finecloud.ch/tags/softwareentwicklung/">software development</a></li></ul><div class="post__share"></div></footer></article><nav class="post__nav"><div class="post__nav-inner"><div class="post__nav-prev"><svg width="1.041em" height="0.416em" aria-hidden="true"><use xlink:href="https://www.finecloud.ch/assets/svg/svg-map.svg#arrow-prev"/></svg> <a href="https://www.finecloud.ch/cleancode.html" class="post__nav-link" rel="prev"><span>Previous</span> CleanCode</a></div><div class="post__nav-next"><a href="https://www.finecloud.ch/spring-annotations.html" class="post__nav-link" rel="next"><span>Next</span> Spring Annotations </a><svg width="1.041em" height="0.416em" aria-hidden="true"><use xlink:href="https://www.finecloud.ch/assets/svg/svg-map.svg#arrow-next"/></svg></div></div></nav></main><footer class="footer"><div class="footer__copyright"><p>Powered by Publii</p></div><button onclick="backToTopFunction()" id="backToTop" class="footer__bttop" aria-label="Back to top" title="Back to top"><svg><use xlink:href="https://www.finecloud.ch/assets/svg/svg-map.svg#toparrow"/></svg></button></footer></div><script>window.publiiThemeMenuConfig = {
mobileMenuMode: 'sidebar',
animationSpeed: 300,
submenuWidth: 'auto',
doubleClickTime: 500,
mobileMenuExpandableSubmenus: true,
relatedContainerForOverlayMenuSelector: '.top',
};</script><script defer="defer" src="https://www.finecloud.ch/assets/js/scripts.min.js?v=6ca8b60e6534a3888de1205e82df8528"></script><script>var images = document.querySelectorAll('img[loading]');
for (var i = 0; i < images.length; i++) {
if (images[i].complete) {
images[i].classList.add('is-loaded');
} else {
images[i].addEventListener('load', function () {
this.classList.add('is-loaded');
}, false);
}
}</script><script defer="defer" src="https://www.finecloud.ch/media/plugins/syntaxHighlighter/prism.js"></script></body></html>