<?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: Stephdotnet</title>
    <description>The latest articles on DEV Community by Stephdotnet (@stephdotnet).</description>
    <link>https://dev.to/stephdotnet</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%2F1029795%2F296df0a3-9f17-445a-a82c-cb11921a24cd.png</url>
      <title>DEV Community: Stephdotnet</title>
      <link>https://dev.to/stephdotnet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stephdotnet"/>
    <language>en</language>
    <item>
      <title>Customize Ubuntu: Make it Feel Like Windows</title>
      <dc:creator>Stephdotnet</dc:creator>
      <pubDate>Mon, 25 Mar 2024 06:57:04 +0000</pubDate>
      <link>https://dev.to/stephdotnet/customize-ubuntu-make-it-feel-like-windows-116f</link>
      <guid>https://dev.to/stephdotnet/customize-ubuntu-make-it-feel-like-windows-116f</guid>
      <description>&lt;p&gt;I like ubuntu, more than i used to, and since i am still a Windows OS user, it helped me to use &lt;strong&gt;GNOME extensions&lt;/strong&gt; in order to make me feel more like “at home”.&lt;/p&gt;

&lt;p&gt;This is a summary of all the extension that i've installed via the GNOME extensions market, and it’s worth saying that although this means 7 extensions for my computer to handle, &lt;strong&gt;it behaves properly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Also if you have a &lt;strong&gt;vertical monitor setup&lt;/strong&gt;, you might absolutely need the &lt;strong&gt;last extension of my list&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dash to panel
&lt;/h2&gt;

&lt;p&gt;For a Windows like UI :&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%2Fuploads%2Farticles%2Fivmb188ayjw8h9l6nyym.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%2Fuploads%2Farticles%2Fivmb188ayjw8h9l6nyym.png" alt="How dash to pannel can look like"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work on a linux based environment but using windows for everything else outside work, &lt;strong&gt;you might need this gem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the list of the &lt;strong&gt;most noteworthy feature&lt;/strong&gt; it has :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ungroup application tiles (if you have a windows 7 nostalgia)&lt;/li&gt;
&lt;li&gt;Live preview on hover&lt;/li&gt;
&lt;li&gt;Show desktop button&lt;/li&gt;
&lt;li&gt;Multi monitor support (and taskbar isolation)&lt;/li&gt;
&lt;li&gt;Custom click behaviours (special mention to middle-click on tile to close application)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/4812/wallpaper-switcher/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/4812/wallpaper-switcher/&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rishuinfinity/WallpaperSwitcher" rel="noopener noreferrer"&gt;https://github.com/rishuinfinity/WallpaperSwitcher&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wallpaper switcher
&lt;/h2&gt;

&lt;p&gt;Ubuntu, or GNOME desktop environment, does not come with a built-in &lt;strong&gt;native wallpaper switcher&lt;/strong&gt; as it aims for simplicity and minimalism. Instead, GNOME encourages users to add functionality through extensions, which allows for personalized customization without cluttering the core system. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡There are many extensions that can do this for GNOME, but if you need such a feature, I can only recommend the simplest one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/4812/wallpaper-switcher/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/4812/wallpaper-switcher/&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rishuinfinity/WallpaperSwitcher" rel="noopener noreferrer"&gt;https://github.com/rishuinfinity/WallpaperSwitcher&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Clipboard history
&lt;/h2&gt;

&lt;p&gt;This is another extension that i miss from windows and that helps me on my daily copy/paste operations. If you’re not familiar with the feature, you might be &lt;strong&gt;enlighted by this discovery&lt;/strong&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%2Fuploads%2Farticles%2Fuojiebxxi3fljhc551tl.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%2Fuploads%2Farticles%2Fuojiebxxi3fljhc551tl.png" alt="Clipboard history extension overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The default shortcut on windows is &lt;code&gt;⊞ win + v&lt;/code&gt; and even if it’s not the default shortcut in this extension you can easily change it for window’s.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 On ubuntu &lt;code&gt;❖ super + v&lt;/code&gt; is used by the system so you might need to unbind it from system shortcuts&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/4839/clipboard-history/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/4839/clipboard-history/&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/SUPERCILEX/gnome-clipboard-history" rel="noopener noreferrer"&gt;https://github.com/SUPERCILEX/gnome-clipboard-history&lt;/a&gt; on github.com&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Audio selector
&lt;/h2&gt;

&lt;p&gt;This one is just a quick-win, when you need to switch from an audio input/output frequently. Since by default this is not possible without navigating in the system preferences, you might find this extension useful.&lt;/p&gt;

&lt;p&gt;Just click on the volume icon 📢 and switch for another source.&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%2Fuploads%2Farticles%2F0p9anx37nfsnpxlf5ppx.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%2Fuploads%2Farticles%2F0p9anx37nfsnpxlf5ppx.png" alt="Audio source switcher preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡It’s also interesting to be able to switch between input, ouput or both&lt;/p&gt;
&lt;/blockquote&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%2Fuploads%2Farticles%2F9ljrgzy54ryero3f33tv.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%2Fuploads%2Farticles%2F9ljrgzy54ryero3f33tv.png" alt="Turn on and off input and output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/5135/audio-selector/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/5135/audio-selector&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/hs65/Gnome-Shell-Extension-Audio-Selector" rel="noopener noreferrer"&gt;https://github.com/hs65/Gnome-Shell-Extension-Audio-Selector&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CPU Freq
&lt;/h2&gt;

&lt;p&gt;It might be useful to monitor at &lt;strong&gt;which frequency your CPU cores&lt;/strong&gt; are running, especially if you run one day into a thermal throttle issue on your laptop. Of course not everyone needs it, but personnaly it’s been very helpful.&lt;/p&gt;

&lt;p&gt;It comes with a taskbar widget, showing you the CPU frequency live, and an extended pannel to manage &lt;strong&gt;power setting&lt;/strong&gt; and monitor each &lt;strong&gt;core activity&lt;/strong&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%2Fuploads%2Farticles%2Fzgoezv7aelbti9ps98z2.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%2Fuploads%2Farticles%2Fzgoezv7aelbti9ps98z2.png" alt="CPU Freq extension overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/1082/cpufreq/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/1082/cpufreq&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/konkor/cpufreq" rel="noopener noreferrer"&gt;https://github.com/konkor/cpufreq&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Emoji selector
&lt;/h2&gt;

&lt;p&gt;This is the cherry on top for anyone who absolutely loves the &lt;strong&gt;emoji selector feature&lt;/strong&gt; on Windows and macOS.&lt;/p&gt;

&lt;p&gt;Nowadays, most apps &lt;strong&gt;give you the ability&lt;/strong&gt; to use emojis within their interface (Notion, Slack, Twitter). But where do you turn when you need to quickly insert an emoji in a text field?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Well, Windows and macOS have a shortcut for that.&lt;/strong&gt; On Ubuntu, you'll struggle a bit more, until you install this extension.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 By default it’s binded on the &lt;code&gt;❖ super + e&lt;/code&gt; shortcut, but i preferer &lt;code&gt;❖ super + .&lt;/code&gt; as it’s the same on windows.&lt;/p&gt;
&lt;/blockquote&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%2Fuploads%2Farticles%2F2uydv78nfxaqqusi3ipv.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%2Fuploads%2Farticles%2F2uydv78nfxaqqusi3ipv.png" alt="Emoji selector extension preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/1162/emoji-selector/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/1162/emoji-selector&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/maoschanz/emoji-selector-for-gnome" rel="noopener noreferrer"&gt;https://github.com/maoschanz/emoji-selector-for-gnome&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gtile
&lt;/h2&gt;

&lt;p&gt;Finally, last but not least, let me introduce you to &lt;strong&gt;Gtile&lt;/strong&gt;. This nifty tool resolved several &lt;strong&gt;Windows layout issues&lt;/strong&gt; I encountered while setting up a &lt;strong&gt;vertical monitor&lt;/strong&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%2Fuploads%2Farticles%2Fakx5t43yq3cpx6x0gasy.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%2Fuploads%2Farticles%2Fakx5t43yq3cpx6x0gasy.png" alt="Gtile used to customize window dimension"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 You should get familiar with the extension shortcuts in order to get productive with it. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It allows you to &lt;strong&gt;split applications vertically&lt;/strong&gt; and position them exactly as you prefer. Gtile is a lifesaver, complete with numerous shortcuts and extensive customization options.&lt;/p&gt;

&lt;p&gt;🔗 Links to the extension store and to the package on github:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://extensions.gnome.org/extension/28/gtile/" rel="noopener noreferrer"&gt;https://extensions.gnome.org/extension/28/gtile&lt;/a&gt; on gnome.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/gTile/gTile" rel="noopener noreferrer"&gt;https://github.com/gTile/gTile&lt;/a&gt; on github&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ubuntu with GNOME&lt;/strong&gt; has evolved into an environment that can serve as a &lt;strong&gt;Windows replacement&lt;/strong&gt;, especially for developers. Thanks to the amazing community contributing by creating &lt;strong&gt;GNOME extensions&lt;/strong&gt;, it now offers many features available on &lt;strong&gt;Windows 11&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to share which extensions have been lifesavers for you, and see you later for more content! ✨👨‍💻&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>ux</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Clean your local git branches</title>
      <dc:creator>Stephdotnet</dc:creator>
      <pubDate>Tue, 27 Feb 2024 07:27:44 +0000</pubDate>
      <link>https://dev.to/stephdotnet/clean-your-local-git-branches-2e69</link>
      <guid>https://dev.to/stephdotnet/clean-your-local-git-branches-2e69</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;When working with Git and a remote repository, you might have faced the scenario where, once in a while, you need to clean your local branches. &lt;br&gt;
This might be time-consuming, and you probably don't really care about it. However, I'll show you my workflow and the simple commands you can alias to clean your local branches in a wink.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;Since I'm working on GitHub, I've configured my repositories to remove head branches when a pull request is merged. &lt;/p&gt;

&lt;p&gt;With this option enabled, your head branch will be deleted after your pull request is merged.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This feature can be useful for identifying stale branches&lt;/p&gt;
&lt;/blockquote&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%2Fuploads%2Farticles%2Fyu5vk10hh5ui0jdvco3w.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%2Fuploads%2Farticles%2Fyu5vk10hh5ui0jdvco3w.png" alt="Deleting branch on merge option on github"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step by step
&lt;/h2&gt;

&lt;p&gt;Let's build the command together as we follow the process.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're not interested in the step-by-step explanations, you can jump to the end of the post, as this command is a one-liner.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Pruning remote
&lt;/h3&gt;

&lt;p&gt;The following command, &lt;code&gt;git remote prune origin&lt;/code&gt;, will allow us to delete remote branch references when the remote branch does not exist. &lt;/p&gt;

&lt;p&gt;Since the remote branch is deleted when the pull request is merged, we need to remove the reference to this branch. &lt;/p&gt;

&lt;p&gt;This is a necessary step, and next, we'll find a way to identify local branches with a "gone" remote.&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%2Fuploads%2Farticles%2Fdqg5pyl935m50oost50l.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%2Fuploads%2Farticles%2Fdqg5pyl935m50oost50l.png" alt="Result of the remote prune origin command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Listing orphan branches
&lt;/h3&gt;

&lt;p&gt;Now that we've removed the remote reference, we'll be able to identify those branches with &lt;code&gt;git branch -vv&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;As you may notice, the flag &lt;code&gt;gone&lt;/code&gt;appears after the origin reference. This is our key to our next steps: isolating and deleting those branches.&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%2Fuploads%2Farticles%2Ffbeq603xt4ljryrd9zg1.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%2Fuploads%2Farticles%2Ffbeq603xt4ljryrd9zg1.png" alt="Result of the branch list command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By using &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;awk&lt;/code&gt; we'll be able to grab the branch names with a missing remote. This is the command i'm using : &lt;code&gt;git branch -vv | grep "gone" | awk '{print $1}'&lt;/code&gt;, and as you can see it works pretty well.&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%2Fuploads%2Farticles%2F3cz1rkw5iq459mxt5c67.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%2Fuploads%2Farticles%2F3cz1rkw5iq459mxt5c67.png" alt="Result of grep and awk on branch list"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deleting the branch
&lt;/h3&gt;

&lt;p&gt;To use the result of the previous command, we'll need xargs since it will allow us to combine the result of a command with another one. So this is the &lt;em&gt;&lt;strong&gt;almost&lt;/strong&gt;&lt;/em&gt; final result&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch -vv | grep "gone" | awk '{print $1}' | xargs git branch --delete&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;As you can see below, this action throws an error. This can be explained by the fact that the branch does not exist on the remote. It's the same error you'll get after a fetch with changes on the remote not present on the local branch.&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%2Fuploads%2Farticles%2Fh96wqed1s9a0dcyc2o3c.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%2Fuploads%2Farticles%2Fh96wqed1s9a0dcyc2o3c.png" alt="Result of the delete branch action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just after, you'll find the final result (which only consists of using the force flag), and now you're able to keep your branch list as clean as your desk!&lt;/p&gt;

&lt;h2&gt;
  
  
  The final result
&lt;/h2&gt;

&lt;p&gt;As we saw together, this is the command you need to alias if you've implemented branch deletion on merge on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch -vv | grep "gone" | awk '{print $1}' | xargs git branch --delete --force&lt;/code&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%2Fuploads%2Farticles%2Fjgbq5tkr08ytke5cypkn.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%2Fuploads%2Farticles%2Fjgbq5tkr08ytke5cypkn.png" alt="Final result of the branch cleaning command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you found it useful, and see you next time! 🫡&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>shell</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Automatic semantic release</title>
      <dc:creator>Stephdotnet</dc:creator>
      <pubDate>Mon, 22 May 2023 17:43:02 +0000</pubDate>
      <link>https://dev.to/stephdotnet/automatic-semantic-release-4f3l</link>
      <guid>https://dev.to/stephdotnet/automatic-semantic-release-4f3l</guid>
      <description>&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;In this post I will describe a way to automate the process of :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a tag based on the changes you've made on your repo&lt;/li&gt;
&lt;li&gt;Publishing a release based on a specific event (eg: push on master)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;If you’re in software development, you might be familiar with semantic versioning. To summarize, it allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep track of the lifecycle of your app and indicate to users what changes were made.&lt;/li&gt;
&lt;li&gt;Allow users of your package to safely update or upgrade newly published versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following semantic versioning conventions (as indicated on &lt;strong&gt;&lt;a href="https://semver.org/" rel="noopener noreferrer"&gt;https://semver.org&lt;/a&gt;&lt;/strong&gt;), you’ll be able to indicate whether you are publishing a fix, a minor change, or a breaking change.&lt;/p&gt;

&lt;p&gt;Semantic versioning is a series of numbers that looks like &lt;strong&gt;X.Y.Z&lt;/strong&gt;, where each number has a meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;X: Breaking change introduced&lt;/li&gt;
&lt;li&gt;Y: A minor change or major change with backward compatibility&lt;/li&gt;
&lt;li&gt;Z: A fix or a patch on your product&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following this convention, you’ll allow users to safely require your package by following version constraints of your dependency manager (such as composer or npm): &lt;strong&gt;&lt;a href="https://getcomposer.org/doc/articles/versions.md#writing-version-constraints" rel="noopener noreferrer"&gt;https://getcomposer.org/doc/articles/versions.md#writing-version-constraints&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Automation?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While it’s easy to choose which version tag you’ll link to a specific commit (usually on your main branch) by using &lt;strong&gt;&lt;code&gt;git tag X.Y.Z &amp;amp;&amp;amp; git push --tags&lt;/code&gt;&lt;/strong&gt;, you might be looking for a way to make this process automatic. Although automation comes with risks, and here we don’t want to mess with our version number.&lt;/p&gt;

&lt;p&gt;To make sure that your changes are recognizable by automation, we are going to follow a convention that helps us identify what type of changes were introduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conventional Commits&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you’re using a VCS to push your code, you’re familiar with the commit history. Conventional naming of your commits is a convention that we’ll follow to help us detect what sort of changes were introduced to our app.&lt;/p&gt;

&lt;p&gt;You can check this website to have a look at what are conventional commits: &lt;strong&gt;&lt;a href="https://www.conventionalcommits.org/en/v1.0.0/" rel="noopener noreferrer"&gt;https://www.conventionalcommits.org/en/v1.0.0/&lt;/a&gt;&lt;/strong&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%2Fuploads%2Farticles%2Fxgri7zbtbfbx1hodj81e.jpg" 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%2Fuploads%2Farticles%2Fxgri7zbtbfbx1hodj81e.jpg" alt="Overview of conventional commits website"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What you just need to know is that by prefixing your commits (or your pull requests name, if you use squash merging), you’ll be able to automate the tag creation and the release of your changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;fix: [description of the change]&lt;/code&gt;&lt;/strong&gt; will indicate a fix or a patch (as well as the &lt;strong&gt;&lt;code&gt;refactor&lt;/code&gt;&lt;/strong&gt; prefix)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;feat: [description of the feature]&lt;/code&gt;&lt;/strong&gt; is equivalent to a minor change&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;feat!: [description of the change]&lt;/code&gt;&lt;/strong&gt; will help us identify breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While conventional commits have a wider variety of syntax, this is basically what you need to know.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;YAC: Yet Another Convention?!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Since following another convention might be a frustrating for you and your team, I’ll give you a tip to help you naming your commits: &lt;strong&gt;&lt;a href="https://github.com/Everduin94/better-commits" rel="noopener noreferrer"&gt;https://github.com/Everduin94/better-commits&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This CLI tool assists you when committing your changes with a set of prompts that will write your commit message for you.&lt;/p&gt;

&lt;p&gt;Also, if you’re using GitHub pull requests (with a squash merge strategy), you might have noticed that your pull requests are named after your first commit name. That way, nothing retains you to WIP your next commits, just make sure the first one reflects the nature of your changes.&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%2Fuploads%2Farticles%2F1mg7lgzmwz4usydandkb.jpg" 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%2Fuploads%2Farticles%2F1mg7lgzmwz4usydandkb.jpg" alt="Preview of the better commits CLI tool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This tool will assist you in writing you conventional commits&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let Your CI Do the Rest&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you’re familiar with GitHub Actions, you might just grab the following gist and go. It’s basically all you need to make everything work in automation.&lt;/p&gt;

&lt;p&gt;If not, you just need to create a &lt;strong&gt;&lt;code&gt;.github/workflows&lt;/code&gt;&lt;/strong&gt; folder at the root of your GitHub project and to create (or paste) the following GitHub action files. Everything will now be automated when pushing&lt;/p&gt;

&lt;p&gt;Also, create your first tag of main manually if you want the automation to work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout origin/main &amp;amp;&amp;amp; git tag 0.1.0 &amp;amp;&amp;amp; git push --tags

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out this &lt;strong&gt;&lt;a href="https://gist.github.com/stephdotnet/ae0c2cc504d40df60ddd04762d0f621c" rel="noopener noreferrer"&gt;gist&lt;/a&gt;&lt;/strong&gt; for the full code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Semantic Release

on:
  push:
    branches:
      - main

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

jobs:
  release:
    permissions:
      contents: write # to create a release (ncipollo/release-action)

    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Get Next Version
        id: semver
        uses: ietf-tools/semver-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          branch: main
          noVersionBumpBehavior: 'silent'

      - name: Create Release
        if: steps.semver.outputs.nextStrict != ''
        uses: ncipollo/release-action@v1.12.0
        with:
          allowUpdates: true
          draft: false
          makeLatest: true
          tag: ${{ steps.semver.outputs.nextStrict }}
          name: ${{ steps.semver.outputs.nextStrict }}
          generateReleaseNotes: true
          token: ${{ secrets.GITHUB_TOKEN }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike some CI workflows, this one is easy to read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;on&lt;/code&gt;: Defines the conditions that will run this workflow. Here, we want to trigger this workflow whenever we push code on &lt;strong&gt;&lt;code&gt;main&lt;/code&gt;&lt;/strong&gt; (eg: merging a pull request)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;concurrency&lt;/code&gt;: It indicates that we only want one workflow at the time. This can be removed if you have multiple teams working on the same repository with continuous delivery.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jobs&lt;/code&gt;: Is where we define the actions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;checkout&lt;/code&gt;: Is just how GitHub retrieves the code for your action.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get next version&lt;/code&gt;: This GitHub action checks your commit names since the previous tag and creates the new tag based on the changes described by your conventional commits. Check the &lt;strong&gt;&lt;a href="https://github.com/ietf-tools/semver-action" rel="noopener noreferrer"&gt;repository&lt;/a&gt;&lt;/strong&gt; if you would like to learn more about it. This action is flexible and will allow you to customize the behavior of the version detection.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;create release&lt;/code&gt;: This will create a release automatically after tag creation. You can have a look at the &lt;strong&gt;&lt;a href="https://github.com/ncipollo/release-action" rel="noopener noreferrer"&gt;repository&lt;/a&gt;&lt;/strong&gt; to know more about this action and the configurations that you can tweak.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Create a Release automatically&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;GitHub releases come with a "generate release notes" feature that will create a summary based on the pull requests merged since the creation of the tag. It can be interesting to have a summary of what's being shipped and to act as a changelog.&lt;/p&gt;

&lt;p&gt;I think that something interesting in that action is that you can generate this release summary thanks to this option &lt;strong&gt;&lt;code&gt;generateReleaseNotes: true&lt;/code&gt;&lt;/strong&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%2Fuploads%2Farticles%2F8752gf3rxxjv2wdn8lu1.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%2Fuploads%2Farticles%2F8752gf3rxxjv2wdn8lu1.png" alt="A github auto generated release"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Github automatic releases are neat&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Diving deeper&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Although this workflow suits my needs, and fits well for a small project, you might need to dig for more examples. There is one that you might like from Tamagui.dev : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/tamagui/tamagui/tree/master/.github/workflows" rel="noopener noreferrer"&gt;https://github.com/tamagui/tamagui/tree/master/.github/workflows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The actions named &lt;code&gt;changelog.yml&lt;/code&gt; and &lt;code&gt;changelog-prerelease.yml&lt;/code&gt; you might find interesting ways to generate and update a release by using a &lt;code&gt;latest&lt;/code&gt; tag&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Using github actions to automate your processes is something that is affordable, free and easy if you start with something like automatic releases. I hope you learned something and that you'll enjoy looking at your automatic semantic versionning while having a cup of tea.&lt;/p&gt;

&lt;p&gt;Cheers ☕&lt;/p&gt;

</description>
      <category>programming</category>
      <category>github</category>
      <category>tutorial</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Update your npm dependencies and your package.json at once !</title>
      <dc:creator>Stephdotnet</dc:creator>
      <pubDate>Mon, 20 Feb 2023 07:10:00 +0000</pubDate>
      <link>https://dev.to/stephdotnet/update-your-npm-dependencies-and-your-packagejson-at-once--38oe</link>
      <guid>https://dev.to/stephdotnet/update-your-npm-dependencies-and-your-packagejson-at-once--38oe</guid>
      <description>&lt;p&gt;I recently stumbled upon an new feature of Composer added on 06/22 named &lt;code&gt;composer bump&lt;/code&gt; (&lt;a href="https://php.watch/articles/composer-bump"&gt;see this post&lt;/a&gt;) which brings a good way to keep track of the updates made to your repository.&lt;/p&gt;

&lt;p&gt;As we all know, versionning is essential for the following reasons : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ability to rollback to a previous version of your code&lt;/li&gt;
&lt;li&gt;Collaborate and handle merge conflicts&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;travel back in time&lt;/strong&gt; to know when a piece of code was modified&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why "updating" your &lt;code&gt;composer.json&lt;/code&gt; at the same time as running &lt;code&gt;composer update&lt;/code&gt; can be a way to know what happened when something goes wrong later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w7neaJo6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxek5iienynpwk8fd7rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w7neaJo6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxek5iienynpwk8fd7rw.png" alt="Composer bump is a great feature" width="880" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the end we have something clear and tracked in time&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What about NPM ?
&lt;/h2&gt;

&lt;p&gt;While doing my chores on a React project i looked for a similar feature with NPM (Node package manager), but surprisingly there is no such thing ! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--__R3poT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjgrvrqkbom52sejcnrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--__R3poT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjgrvrqkbom52sejcnrt.png" alt="Chat gpt answer" width="786" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Chat-GPT struggled with my question... A LOT 😅 Npm version is not the right answer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The savior: NCU
&lt;/h2&gt;

&lt;p&gt;Sometimes, you’re just glad to find a package that makes everything that you need, and even more. The chosen one is &lt;a href="https://www.npmjs.com/package/npm-check-updates"&gt;Npm check update&lt;/a&gt; made by &lt;strong&gt;&lt;a href="https://dev.to/raineorshine"&gt;Raine Revere&lt;/a&gt;&lt;/strong&gt; and it allows you to : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List all new dependencies&lt;/li&gt;
&lt;li&gt;Interactively upgrade them&lt;/li&gt;
&lt;li&gt;Upgrade your package.json&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if you want to have a package.json file up to date with your locked dependencies just install the package globally&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g npm-check-updates&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And run &lt;code&gt;ncu -u&lt;/code&gt; to upgrade your &lt;code&gt;package.json&lt;/code&gt; &lt;br&gt;
&lt;strong&gt;Don’t forget&lt;/strong&gt; to run &lt;code&gt;npm install&lt;/code&gt; to install the updates and to renegerate your &lt;code&gt;package-lock.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You'll end up with this nice diff while commiting your dependencies update&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qYgdbMAq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgimd5nwfh1rshqw5unv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qYgdbMAq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgimd5nwfh1rshqw5unv.png" alt="Package.json upgrade with NCU -u" width="880" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully it was useful to you 👋&lt;/p&gt;

</description>
      <category>npm</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
