<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sebastian</title>
    <description>The latest articles on DEV Community by Sebastian (@ebud7).</description>
    <link>https://dev.to/ebud7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4324%2F94d9d09e-4595-4439-abdc-c50bb0daf8a5.JPG</url>
      <title>DEV Community: Sebastian</title>
      <link>https://dev.to/ebud7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ebud7"/>
    <language>en</language>
    <item>
      <title>Two hacks for a seamless Zoom experience </title>
      <dc:creator>Sebastian</dc:creator>
      <pubDate>Wed, 13 May 2020 06:58:50 +0000</pubDate>
      <link>https://dev.to/ebud7/two-zoom-hacks-for-a-seamless-experience-286m</link>
      <guid>https://dev.to/ebud7/two-zoom-hacks-for-a-seamless-experience-286m</guid>
      <description>&lt;h1&gt;
  
  
  Hack #1 - Open Zoom without prompt
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Issue
&lt;/h2&gt;

&lt;p&gt;You know the pain. &lt;br&gt;
For every new Zoom call you have to confirm a prompt in order to join it.&lt;br&gt;
No matter what kind of calendar or meeting reminder you're using, you can't avoid to open chrome and submit the prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T16PZ2t2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xoftsugjqnsnktf0lznn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T16PZ2t2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xoftsugjqnsnktf0lznn.png" alt="Chrome prompt without checkbox"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Using an older chrome version to get the checkbox back?&lt;br&gt;
No, not really an option.&lt;/p&gt;

&lt;p&gt;Luckily this feature is not gone, just hidden. &lt;br&gt;
Follow this simple steps to get it back:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Have Chrome version &amp;gt; 79&lt;/li&gt;
&lt;li&gt;Run the following command in terminal &lt;code&gt;​defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Restart Chrome&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After restarting chrome you're able to tick the checkbox to always open Zoom directly without prompting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AoDUzvgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6v2oq00ptrp0b5hn3wgq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AoDUzvgD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6v2oq00ptrp0b5hn3wgq.png" alt="Chrome prompt with checkbox"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Hack #2 - Zoom Closer for Google Chrome
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Issue
&lt;/h2&gt;

&lt;p&gt;You're pretty busy and hopping from call to call.&lt;br&gt;
Every new call is a new tab in Chrome and you end up like this...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_sLSQS9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/rkkrqcfruo3ydackkjqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_sLSQS9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/rkkrqcfruo3ydackkjqh.png" alt="Open zoom tabs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Some smart people came up with Chrome plugins for this issue.&lt;br&gt;
Every new tab is just temporarily open and will be closed automatically.&lt;/p&gt;

&lt;p&gt;Just search for "Zoom Tab Closer" in the chrome web store and install one.&lt;br&gt;
I linked the &lt;em&gt;Zoom Closer&lt;/em&gt; which works pretty fine for me.&lt;/p&gt;

&lt;h1&gt;
  
  
  Credits
&lt;/h1&gt;

&lt;p&gt;[1] &lt;a href="https://superuser.com/questions/1498967/how-to-always-open-certain-app-links-in-chrome-without-prompt"&gt;https://superuser.com/questions/1498967/how-to-always-open-certain-app-links-in-chrome-without-prompt&lt;/a&gt;&lt;br&gt;
[2] &lt;a href="https://chrome.google.com/webstore/detail/zoom-closer/appjbedfhcmpknanmbndpojcllfaemal"&gt;https://chrome.google.com/webstore/detail/zoom-closer/appjbedfhcmpknanmbndpojcllfaemal&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zoom</category>
      <category>remote</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Do you know Project Lombok?</title>
      <dc:creator>Sebastian</dc:creator>
      <pubDate>Fri, 21 Apr 2017 20:57:28 +0000</pubDate>
      <link>https://dev.to/ebud7/project-lombok</link>
      <guid>https://dev.to/ebud7/project-lombok</guid>
      <description>&lt;p&gt;I've been using and appreciating Lombok for some time. It's one of the first dependencies I drop into my Java projects. This article is just about making you curious writing less, more clean code and of course save some time. &lt;/p&gt;

&lt;p&gt;â³&lt;/p&gt;

&lt;h1&gt;
  
  
  What kind of problem solves Project Lombok? ðŸ‘€
&lt;/h1&gt;

&lt;p&gt;Well I think this quote is nailing it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Boilerplate" is a term used to describe code that is repeated in many parts of an application with little alteration. One of the most frequently voiced criticisms of the Java language is the volume of this type of code that is found in most projects. This problem is frequently a result of design decisions in various libraries, but is exacerbated by limitations in the language itself. Project Lombok aims to reduce the prevalence of some of the worst offenders by replacing them with a simple set of annotations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/mkimberlin"&gt;Michael Kimberlin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Show me some code! ðŸ™
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.codebud7.example;

import lombok.Builder;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;

@Log // or: @Slf4j @CommonsLog @Log4j @Log4j2 @XSlf4j
public class LombokDemoApplication
{
    public static void main(String[] args)
    {
        Article article = Article.builder()
            .title("Project Lombok")
            .published(false)
            .description("It's magic!")
            .build();

        log.info(article.toString());
    }
}

@Getter
@Builder // or: @Setter
@ToString
class Article
{
    private String title;
    private Boolean published;
    private String description;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a small example of some powerful Lombok features. &lt;/p&gt;

&lt;p&gt;On top of the LombokDemoApplication class you can see the &lt;code&gt;@Log&lt;/code&gt; annotation. Instead of declaring an instance of a logger framework of your choice Project Lombok is doing this for you to save common declarations.&lt;/p&gt;

&lt;p&gt;Let's have a look at the Article class. Use &lt;code&gt;@Getter&lt;/code&gt; and you never will write &lt;br&gt;
&lt;code&gt;public int getFoo() {return foo;}&lt;/code&gt; again. The &lt;code&gt;@Builder&lt;/code&gt; annotation produces complex builder APIs for your classes and &lt;code&gt;@ToString&lt;/code&gt; is printing your class name, along with each field, in order, separated by commas by default.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next steps ðŸŽ“
&lt;/h1&gt;

&lt;p&gt;So if you're curious and want to know some more details about Project Lombok you should visit the following sites:&lt;/p&gt;

&lt;p&gt;ðŸ‘‰ &lt;a href="https://projectlombok.org/index.html"&gt;The official project Lombok docs&lt;/a&gt;&lt;br&gt;
ðŸ‘‰ &lt;a href="http://www.baeldung.com/intro-to-project-lombok"&gt;Nice introduction to more Lombok features by baeldung&lt;/a&gt;&lt;/p&gt;

</description>
      <category>lombok</category>
      <category>java</category>
    </item>
    <item>
      <title>About Maven version ranges</title>
      <dc:creator>Sebastian</dc:creator>
      <pubDate>Wed, 29 Mar 2017 18:13:18 +0000</pubDate>
      <link>https://dev.to/ebud7/maven-version-ranges</link>
      <guid>https://dev.to/ebud7/maven-version-ranges</guid>
      <description>&lt;p&gt;Hey folks&lt;/p&gt;

&lt;p&gt;this week I stumbled across problems with maven dependency version ranges.&lt;/p&gt;

&lt;p&gt;So here we are - a short article about maven dependency version ranges and possible advantages/disadvantages based on my experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are version ranges?
&lt;/h1&gt;

&lt;p&gt;Maven allows you to define a range of version numbers (In a specific format) to resolve automatically the latest version of a defined dependency by the next build execution.&lt;/p&gt;

&lt;h1&gt;
  
  
  What version ranges am I able to specify?
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;x &amp;gt;= 1.0 * The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions here, so it has been redefined as a minimum version.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(,1.0]&lt;/td&gt;
&lt;td&gt;x &amp;lt;= 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(,1.0)&lt;/td&gt;
&lt;td&gt;x &amp;lt; 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[1.0]&lt;/td&gt;
&lt;td&gt;x == 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[1.0,)&lt;/td&gt;
&lt;td&gt;x &amp;gt;= 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(1.0,)&lt;/td&gt;
&lt;td&gt;x &amp;gt; 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(1.0,2.0)&lt;/td&gt;
&lt;td&gt;1.0 &amp;lt; x &amp;lt; 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[1.0,2.0]&lt;/td&gt;
&lt;td&gt;1.0 &amp;lt;= x &amp;lt;= 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(,1.0],[1.2,)&lt;/td&gt;
&lt;td&gt;x &amp;lt;= 1.0 or x &amp;gt;= 1.2. Multiple sets are comma-separated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(,1.1),(1.1,)&lt;/td&gt;
&lt;td&gt;x != 1.1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;com.example&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;healthcheck&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;[0.0.5,0.3.0)&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  What's the current version?
&lt;/h1&gt;

&lt;p&gt;You're able to get the actual version by running &lt;code&gt;mvn dependency:list |grep healthcheck&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;The result will provide the actual version number. It could look like this: &lt;code&gt;[INFO] com.example:healthcheck:jar:0.0.7:compile&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why should I use it?
&lt;/h1&gt;

&lt;p&gt;It's magic. An update to newer dependencies within the defined ranges without hitting the keyboard. So less work to keep an eye for any updates and "magic" gain of possible new features/fixes of the dependency.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why not?
&lt;/h1&gt;

&lt;p&gt;You never can't be sure that newer versions are compatible to your code and are unbroken. So it could be possible that you're build/compilation will magically be broke caused of newer dependencies.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Well in my opinion the usage of version ranges is a matter of taste and also depends of the used technology. For example in the JavaScript ðŸŒŽ version ranges are more recommended and popular. &lt;/p&gt;

&lt;p&gt;For Maven especially I like to avoid version ranges to keep my dependency list clean and short to have a better overview about used versions, certain sub-dependencies and avoid possible site effect of magic updates. &lt;/p&gt;

&lt;h1&gt;
  
  
  Hints
&lt;/h1&gt;

&lt;p&gt;You can resolve newer dependency versions by using &lt;code&gt;mvn versions:display-dependency-updates&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace version ranges automatically by run &lt;code&gt;mvn versions:resolve-ranges&lt;/code&gt; or based on specific groupId's &lt;code&gt;mvn versions:resolve-ranges -Dincludes=com.example:*&lt;/code&gt; (',' separation possible)&lt;/p&gt;

&lt;p&gt;Be careful resolving SNAPSHOT dependencies by version ranges. They could be under construction and manipulate your expected behavior.&lt;/p&gt;

&lt;h4&gt;
  
  
  RELATED:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html"&gt;Official apache maven docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apache</category>
      <category>maven</category>
    </item>
    <item>
      <title>How to customise your git commit message</title>
      <dc:creator>Sebastian</dc:creator>
      <pubDate>Sat, 25 Mar 2017 15:34:43 +0000</pubDate>
      <link>https://dev.to/ebud7/how-to-customise-your-git-commit-message-</link>
      <guid>https://dev.to/ebud7/how-to-customise-your-git-commit-message-</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Add default template directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.templatedir &lt;span class="s1"&gt;'~/.git-templates'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Files and directories in the default template directory (~/.git-templates) whose name do not start with a dot will be copied to the specific $GitDir after it is created.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See &lt;a href="https://git-scm.com/docs/git-init" rel="noopener noreferrer"&gt;git-init&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Add default hook directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.git-templates/hooks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;The hooks are stored in the hooks subdirectory of the default template directory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See &lt;a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks" rel="noopener noreferrer"&gt;git-hooks&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Add your first hook (e.g. prepare-commit-msg)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi ~/.git-templates/hooks/prepare-commit-msg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Add a custom hook that puts your branch name to the top of your commit message. (Excluding master, develop)&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BRANCHES_TO_SKIP&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nv"&gt;BRANCHES_TO_SKIP&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;master develop &lt;span class="nb"&gt;test&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nv"&gt;BRANCH_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git symbolic-ref &lt;span class="nt"&gt;--short&lt;/span&gt; HEAD&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;BRANCH_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;BRANCH_NAME&lt;/span&gt;&lt;span class="p"&gt;##*/&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nv"&gt;BRANCH_EXCLUDED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;BRANCHES_TO_SKIP&lt;/span&gt;&lt;span class="p"&gt;[@]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"^&lt;/span&gt;&lt;span class="nv"&gt;$BRANCH_NAME&lt;/span&gt;&lt;span class="s2"&gt;$"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;BRANCH_IN_COMMIT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\[&lt;/span&gt;&lt;span class="nv"&gt;$BRANCH_NAME&lt;/span&gt;&lt;span class="se"&gt;\]&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BRANCH_NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$BRANCH_EXCLUDED&lt;/span&gt; &lt;span class="nt"&gt;-eq&lt;/span&gt; 1 &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$BRANCH_IN_COMMIT&lt;/span&gt; &lt;span class="nt"&gt;-ge&lt;/span&gt; 1 &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then 
  &lt;/span&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;.bak &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"1s/^/&lt;/span&gt;&lt;span class="nv"&gt;$BRANCH_NAME&lt;/span&gt;&lt;span class="s2"&gt; /"&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;See &lt;a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks" rel="noopener noreferrer"&gt;git-hooks&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Make the hook executable&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x ~/.git-templates/hooks/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Git hooks are not made executable by default.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Re-initialize git in each existing repository&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;To use your new hook you have to re-initialize git.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See &lt;a href="https://git-scm.com/docs/git-init" rel="noopener noreferrer"&gt;git-init&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Commit&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;How does it look like?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FcodeBud7%2Farticles%2Fblob%2Fmaster%2Fimg%2Fhow-to-customise-your-git-commit-message.png%3Fraw%3Dtrue" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FcodeBud7%2Farticles%2Fblob%2Fmaster%2Fimg%2Fhow-to-customise-your-git-commit-message.png%3Fraw%3Dtrue" title="Sample" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Automation&lt;/strong&gt;&lt;br&gt;
If you'd like to add the same commit message for every git project you could  configure something like this:&lt;/p&gt;

&lt;p&gt;First create your template file. (For example &lt;code&gt;~/.gitmessage&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Why:
&lt;span class="k"&gt;*&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that you can simply add this file to your &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;commit]
    template &lt;span class="o"&gt;=&lt;/span&gt; ~/.gitmessage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Hints
&lt;/h1&gt;

&lt;p&gt;ðŸ‘‰ If a hook is already defined in your local git repository the new hook won't overwrite it.&lt;br&gt;
ðŸ‘‰ You might have to set the permissions on your new hook. (sudo chmod 775 .git/hooks/prepare-commit-msg)&lt;/p&gt;

&lt;h5&gt;
  
  
  RELATED:
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://chris.beams.io/posts/git-commit/" rel="noopener noreferrer"&gt;Chris Beams about git commit messages&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
