<?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: Leah Vogel</title>
    <description>The latest articles on DEV Community by Leah Vogel (@leah_m_vogel).</description>
    <link>https://dev.to/leah_m_vogel</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%2F494467%2Fb746c408-246d-443b-b3af-8030c62f6151.jpg</url>
      <title>DEV Community: Leah Vogel</title>
      <link>https://dev.to/leah_m_vogel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leah_m_vogel"/>
    <language>en</language>
    <item>
      <title>Custom Alias / Shortcut in mac Terminal</title>
      <dc:creator>Leah Vogel</dc:creator>
      <pubDate>Fri, 19 Aug 2022 14:40:34 +0000</pubDate>
      <link>https://dev.to/leah_m_vogel/custom-alias-shortcut-in-mac-terminal-21e8</link>
      <guid>https://dev.to/leah_m_vogel/custom-alias-shortcut-in-mac-terminal-21e8</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;$ open ~/.zshrc&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ alias yoursmartaliasname='your smart command' #no spaces before or after the equal sign&lt;/code&gt;&lt;br&gt;
&lt;code&gt;# save your text file&lt;/code&gt;&lt;br&gt;
&lt;code&gt;# restart terminal to use your new alias&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydc9whi33gxmv0vfkis0.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydc9whi33gxmv0vfkis0.jpeg" alt="Image description" width="750" height="308"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Many moons ago I was irritated by the fact that I had a lot of local branches of work on my computer, after those branches had already been pushed, reviewed and merged into the remote repository. I wanted to delete them locally as well.&lt;br&gt;
I found a cool command to clean them up, but there was no way I would be able to remember it when needed. I put it on a digital sticky note (at the time, a text file, easily accessible for the good old copy-paste) and I copied it from there whenever I needed it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here’s the command — just in case you need it too:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;git branch — merged | egrep -v “(^\*|main|develop)” | xargs git branch -d&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;I know, I know — pasting from a text file isn’t the most efficient way of doing things.&lt;/p&gt;

&lt;p&gt;I thought to myself, there must be a better way… and of course there is!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a custom alias (or shortcut) to be used in the command line for easy usage.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So let’s learn how to define an alias! Important to note: in order for the alias to be permanent, you need to save it in your terminal’s config file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who is your terminal?
&lt;/h2&gt;

&lt;p&gt;To find out which type of shell your terminal is using, type in the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ echo SHELL #all caps&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Open your config file:
&lt;/h2&gt;

&lt;p&gt;Based on the output you then open your config file, as follows:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51xu3v82qkpjiwh0breq.jpeg" alt="Image description" width="750" height="394"&gt;
&lt;/h2&gt;

&lt;p&gt;This will open the config file for editing, using your default editor.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Warning to the wise, make sure you know how to save and exit your text editor&lt;/strong&gt; 😃&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6voit2d7acerza9vdw1.png" alt="Image description" width="800" height="275"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Set up the alias:
&lt;/h2&gt;

&lt;p&gt;You will then need to type the alias, making sure to have a quote around your command, and no spaces before or after the equal sign:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias prune='git branch — merged | egrep -v “(^\*|main|develop)” | xargs git branch -d'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I decided to call my alias &lt;strong&gt;prune&lt;/strong&gt;, because it’s similar to the git prune command, because in my head it made sense (which is the only thing that matters because it’s a custom alias for my own computer 🙃).&lt;/p&gt;




&lt;h2&gt;
  
  
  Save and Restart Terminal
&lt;/h2&gt;

&lt;p&gt;Next, save your config file and restart your terminal for the alias to be used.&lt;/p&gt;

&lt;p&gt;Now, running that command looks like this for me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkbnoa01ie6jjj39azir.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkbnoa01ie6jjj39azir.jpeg" alt="Image description" width="750" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  That’s it! Happy aliasing 🧑🏻‍💻🤩
&lt;/h2&gt;




&lt;p&gt;&lt;em&gt;originally posted at &lt;a href="https://medium.com/@vogeleah/custom-alias-shortcut-in-mac-terminal-26a6b688d133"&gt;https://medium.com/@vogeleah/custom-alias-shortcut-in-mac-terminal-26a6b688d133&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>shortcut</category>
      <category>tutorial</category>
      <category>commandline</category>
    </item>
    <item>
      <title>Tags vs Branches in Git</title>
      <dc:creator>Leah Vogel</dc:creator>
      <pubDate>Thu, 18 Mar 2021 06:02:58 +0000</pubDate>
      <link>https://dev.to/leah_m_vogel/tags-vs-branches-in-git-4pm</link>
      <guid>https://dev.to/leah_m_vogel/tags-vs-branches-in-git-4pm</guid>
      <description>&lt;p&gt;New to version control? Welcome! 👋 Understanding the lingo is very important. This can be overwhelming, but don’t worry, you’ll get there!&lt;/p&gt;

&lt;p&gt;In this short post I will explain what a branch and what a tag is, what they are used for and the differences between them.&lt;br&gt;
...&lt;br&gt;
As defined in gitglossary:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;branch&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A “branch” is an active line of development. The most recent commit on a branch is referred to as the tip of that branch. The tip of the branch is referenced by a branch head, which moves forward as additional development is done on the branch. A single git repository can track an arbitrary number of branches, but your working tree is associated with just one of them (the “current” or “checked out” branch), and HEAD points to that branch.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;tag&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A ref pointing to a tag or commit object. In contrast to a head, a tag is not changed by a commit[...]. A tag is most typically used to mark a particular point in the commit ancestry chain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Branches:
&lt;/h2&gt;

&lt;p&gt;Let’s explain how this works in real life.&lt;br&gt;
You write code on a branch. You may have a repository with only one branch (master), and then code you commit would be added to that branch. A more common workflow is to create (checkout) a new branch when working on a feature or a bug, stemming from a master or develop branch. When your work is completed, saved (committed) and pushed remotely, hopefully your code will be reviewed and merged into the main development branch.&lt;br&gt;
When you checkout a branch, it points to the most recent commit that you have locally. Branches are dynamic and code can be added to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tags:
&lt;/h2&gt;

&lt;p&gt;A tag points to a specific commit on any branch. You cannot add more code to a tag — it is a reference to a specific commit, kind of like a snapshot.&lt;br&gt;
When would you want something like this? It is useful to create tags when releasing versions. When checking out a tag you can always be sure you’ll be getting the same code each time.&lt;/p&gt;

&lt;h2&gt;
  
  
  In conclusion:
&lt;/h2&gt;

&lt;p&gt;A branch is an active line of development whereas a tag is a an immutable reference to a specific commit on a branch.&lt;br&gt;
...&lt;br&gt;
Hope that clears up some confusion for you. Happy developing!&lt;/p&gt;

</description>
      <category>git</category>
      <category>versioncontrol</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
