<?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>Forem: Stefan Antal</title>
    <description>The latest articles on Forem by Stefan Antal (@himynameissteve).</description>
    <link>https://forem.com/himynameissteve</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%2F480175%2F23414280-3579-41ae-b3e8-3d817062bd57.png</url>
      <title>Forem: Stefan Antal</title>
      <link>https://forem.com/himynameissteve</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/himynameissteve"/>
    <language>en</language>
    <item>
      <title>Why I was ready to pay for a Git client</title>
      <dc:creator>Stefan Antal</dc:creator>
      <pubDate>Tue, 10 Nov 2020 15:31:02 +0000</pubDate>
      <link>https://forem.com/studio_m_song/why-i-was-ready-to-pay-for-a-git-client-570l</link>
      <guid>https://forem.com/studio_m_song/why-i-was-ready-to-pay-for-a-git-client-570l</guid>
      <description>&lt;p&gt;For years, I've been using Sourcetree as my go-to-tool for all Git related actions and repository management. It did all I could wish for and I couldn't imagine why someone would pay for a Git client. Until I stumbled across GitKraken (&lt;a href="https://www.gitkraken.com/" rel="noopener noreferrer"&gt;https://www.gitkraken.com/&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw45x8y5wtwpq5tawg8af.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw45x8y5wtwpq5tawg8af.png" alt="GitKraken"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;- Picture taken from GitKraken's website.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  My workflow
&lt;/h1&gt;

&lt;p&gt;To understand why I changed my mind, it might be interesting to understand, how I work.&lt;/p&gt;

&lt;p&gt;Here's a standard workflow, I usually follow:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F65ze7nf12toeko8tvpap.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F65ze7nf12toeko8tvpap.png" alt="Sourcetree workflow"&gt;&lt;/a&gt;&lt;br&gt;
At my work, we use GitLab / GitHub for code management and pipelines and often feature branches to structure the way teams work. Pretty standard, no special things here ✌️.&lt;/p&gt;

&lt;p&gt;To finish a piece of work, I usually have to work with three tools: &lt;strong&gt;Sourcetree&lt;/strong&gt;, &lt;strong&gt;GitLab,&lt;/strong&gt; and &lt;strong&gt;Jira&lt;/strong&gt; (not shown in this picture).&lt;/p&gt;

&lt;p&gt;The context switches between these tools were never something that bothered me. I always thought that this is how it is to code nowadays. In conversations with my colleagues, I've heard that some used a different Git client (like GitTower &lt;a href="https://www.git-tower.com/mac" rel="noopener noreferrer"&gt;https://www.git-tower.com/mac&lt;/a&gt;) and so I stumbled across GitKraken during a Google search. Due to a recent change in their pricing structure, I was ready to give it a spin, and oh boy, did this tool go to town (with me).&lt;/p&gt;

&lt;h1&gt;
  
  
  My new workflow
&lt;/h1&gt;

&lt;p&gt;After I learned about some of GitKraken's features, my new (improved) workflow looks like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5kac90xlc8158yzbvmmy.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5kac90xlc8158yzbvmmy.png" alt="GitKraken workflow"&gt;&lt;/a&gt;&lt;br&gt;
First of all, I can stay in my Git tool to create merge requests. Can we just pause for a second and process this? It doesn't feel like much but go dare and try. It's wild 🔥!&lt;/p&gt;

&lt;p&gt;Secondly, I can still stay in my Git tool to see the issues which are assigned to me in Jira, change them, and move them in their workflow.&lt;/p&gt;

&lt;p&gt;If that doesn't get you off your seat and have you throwing money at this tool, I'll throw in an epic undo/redo feature which lets you reverse and redo actions (I already see the comments, where you complain that you can't take back a commit after you've pushed it. It doesn't change Git. It supports you). With the undo feature, I don't have to look up reset commands any more or do hard resets because it's sometimes cumbersome to reverse an action (Yeah yeah, it's good to know what's happening under the hood, I got you. I've been under the hood when I started with the terminal for the first couple of years. I'm entitled to have some nice things in life, ok?).&lt;/p&gt;

&lt;h1&gt;
  
  
  The result
&lt;/h1&gt;

&lt;p&gt;"A whole new wooooorld...". At least it feels like it. I brought my contexts down from three to two and profit from other sweet features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple profiles (in sync with your &lt;code&gt;.gitconfig&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Great merge conflict editor (no more "mine" and "theirs" 🤷‍♂️)&lt;/li&gt;
&lt;li&gt;Fast, responsive UI&lt;/li&gt;
&lt;li&gt;Auto-Stashing at merge conflicts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and many more.&lt;/p&gt;

&lt;h1&gt;
  
  
  Dear Santa...
&lt;/h1&gt;

&lt;p&gt;Now, if I could just bring my contexts down to 1 (!)... I found out that this context thing really grinds my gears or at least hinders productivity. I've talked with Axosoft (the company behind GitKraken) and they have more GitLab support on their board and &lt;code&gt;+1&lt;/code&gt;ed it for me. &lt;strong&gt;Always talk with the companies and let them know what you need. Maybe it pays out someday&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And just because it reads like a paid article: it’s not. I’m just hyped 🙈&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Git Configuration Reuse</title>
      <dc:creator>Stefan Antal</dc:creator>
      <pubDate>Mon, 12 Oct 2020 20:41:10 +0000</pubDate>
      <link>https://forem.com/studio_m_song/git-configuration-reuse-13bm</link>
      <guid>https://forem.com/studio_m_song/git-configuration-reuse-13bm</guid>
      <description>&lt;p&gt;This post has been written from the perspective of a macOS user.&lt;/p&gt;

&lt;p&gt;Working for an agency has its perks. Diverse &amp;amp; interesting people, less bullshit &amp;amp; more doing, working for different clients, and so on. Especially the “working for different clients” part can have its challenges, though.&lt;/p&gt;

&lt;p&gt;One is that with some clients, we need to use external email addresses provided by them. Not just for communication but also for more technical things like logins and Git commits.&lt;br&gt;
I want to show you a neat trick to manage your different configurations for Git easily and comfortably.&lt;/p&gt;
&lt;h1&gt;
  
  
  The Situation
&lt;/h1&gt;

&lt;p&gt;Git manages some meta information in the global &lt;code&gt;.gitconfig&lt;/code&gt;. Here’s mine:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AtEih-7b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yrqcr3aa5krdc11k1xka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AtEih-7b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yrqcr3aa5krdc11k1xka.png" alt="Alt Text" width="880" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The global user configuration is under &lt;code&gt;[user]&lt;/code&gt; and sets the name and email for Git. This will be applied to all my Git projects if there’s no local configuration, which overrides it.&lt;/p&gt;

&lt;p&gt;Let’s imagine that with the fictional company “acme labs”, we would be required to use external accounts provided by the client. If you’re not careful, you will end up with commits like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nPlrRk9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cczagag9hqbb6qlemro9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nPlrRk9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cczagag9hqbb6qlemro9.png" alt="Alt Text" width="880" height="74"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  The easy Fix
&lt;/h1&gt;

&lt;p&gt;You probably know that there is a global Git configuration that will be applied to all your projects if not overridden by a local configuration.&lt;br&gt;
It resides under &lt;code&gt;~/.gitconfig&lt;/code&gt;. You can set its values by editing this file or by the &lt;code&gt;git config&lt;/code&gt; command with the &lt;code&gt;--global&lt;/code&gt; option.&lt;br&gt;
For your user and email, that would be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config --global add user.name “Stefan Antal”&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git config --global add user.email “Stefan.Antal@sinnerschrader.com”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In this way, you can also set local Git configuration options by removing the &lt;code&gt;--global&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;Switch to your project folder (for me this would be &lt;code&gt;~/code/acme-labs&lt;/code&gt;) where you have your &lt;code&gt;.git&lt;/code&gt; folder and run the commands without the &lt;code&gt;--global&lt;/code&gt; flag:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config add user.name “Stefan Antal (external)”&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git config add user.email “Stefan.Antal@external.acme.labs”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will add your project-specific user and email to &lt;code&gt;.git/config&lt;/code&gt;.&lt;br&gt;
All values present in this file will override its global counterpart for this project.&lt;/p&gt;

&lt;p&gt;This is all perfectly fine if that’s all you need.&lt;br&gt;
But what if you would like to reuse some values multiple times?&lt;/p&gt;
&lt;h1&gt;
  
  
  The sophisticated Fix
&lt;/h1&gt;

&lt;p&gt;You can include files from all kinds of places into your Git configuration. I like to gather my different configuration files in a common-place like &lt;code&gt;~/git-configs/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s create a file that we call &lt;code&gt;acme-labs&lt;/code&gt; (the name doesn’t matter) inside our &lt;code&gt;git-configs&lt;/code&gt; folder.&lt;br&gt;
I create a config file for each project which needs to have a separate configuration.&lt;/p&gt;

&lt;p&gt;The content of &lt;code&gt;acme-labs&lt;/code&gt; will be this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dWsWavJB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xkwao1xmqg6y1qgn94w2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dWsWavJB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xkwao1xmqg6y1qgn94w2.png" alt="Alt Text" width="880" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to tell Git to use this configuration when we’re working for acme-labs.&lt;br&gt;
To achieve this, we’ll use the &lt;code&gt;includeif&lt;/code&gt; option inside our global Git configuration.&lt;/p&gt;

&lt;p&gt;Modify your global Git configuration (&lt;code&gt;~/.gitconfig&lt;/code&gt;) by adding following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[includeIf "gitdir:~/code/acme-labs/"]
        path = ~/git-configs/acme-labs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;gitdir&lt;/code&gt; shall point to the folder where your local &lt;code&gt;.git&lt;/code&gt; folder is.&lt;br&gt;
&lt;code&gt;path&lt;/code&gt; shall point to your newly created Git configuration for acme-labs.&lt;/p&gt;

&lt;p&gt;The result should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m6p4dLpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6wp5qvfpq09s9pdskz20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m6p4dLpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6wp5qvfpq09s9pdskz20.png" alt="Alt Text" width="880" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Git will recognize when you’re working inside &lt;code&gt;~/code/acme-labs&lt;/code&gt; and use the values you defined under &lt;code&gt;~/git-configs/acme-labs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this way, you only have to add a new &lt;code&gt;includeif&lt;/code&gt; per project inside your global Git configuration and link it to one of your configuration files.&lt;/p&gt;

&lt;p&gt;Your next commit will now look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1K27ApNP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eye3fmv3q2ritbto8lyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1K27ApNP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eye3fmv3q2ritbto8lyl.png" alt="Alt Text" width="880" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if you also have regular local Git configuration, which you have added with &lt;code&gt;git config add&lt;/code&gt;, it will be used instead of your &lt;code&gt;~/code/acme-labs&lt;/code&gt; configuration.&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
