<?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: Travis Swicegood</title>
    <description>The latest articles on DEV Community by Travis Swicegood (@tswicegood).</description>
    <link>https://dev.to/tswicegood</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%2F30165%2Fe264052f-5abd-4892-863a-9d34431f0a1a.jpg</url>
      <title>DEV Community: Travis Swicegood</title>
      <link>https://dev.to/tswicegood</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tswicegood"/>
    <language>en</language>
    <item>
      <title>Git aliases I can't live without</title>
      <dc:creator>Travis Swicegood</dc:creator>
      <pubDate>Tue, 06 Aug 2019 21:56:55 +0000</pubDate>
      <link>https://dev.to/tswicegood/git-aliases-i-can-t-live-without-45j1</link>
      <guid>https://dev.to/tswicegood/git-aliases-i-can-t-live-without-45j1</guid>
      <description>&lt;p&gt;I try to avoid using aliases in my daily shell usage. I've taught using Git for over a decade now and I don't want to have to translate &lt;code&gt;gup&lt;/code&gt; to &lt;code&gt;git fetch &amp;amp;&amp;amp; git rebase&lt;/code&gt; or &lt;code&gt;gcp&lt;/code&gt; to git cherry-pick`. I've got &lt;a href="https://github.com/Bash-it/bash-it/blob/master/completion/available/git.completion.bash"&gt;completion&lt;/a&gt; installed and use it, but at least this way I'm seeing the commands that are being used so I keep that muscle memory fresh.&lt;/p&gt;

&lt;p&gt;That's not to say I don't use &lt;em&gt;any&lt;/em&gt; aliases. I constantly trip myself up on new machines because I've come to expect &lt;code&gt;git st&lt;/code&gt; or &lt;code&gt;git di&lt;/code&gt; to be aliased to &lt;code&gt;git status&lt;/code&gt; or &lt;code&gt;git diff&lt;/code&gt; (some Subversion habits die hard). There are a couple that I've recently added that I find myself reaching for multiple times a day.&lt;/p&gt;

&lt;p&gt;Everything builds off of &lt;code&gt;git delete-merged&lt;/code&gt;. It's a simple alias that runs this command (full aliases below):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch --merged | grep -v '^\*' | xargs git branch -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This takes the list of all branches, filters out the current branch, then run &lt;code&gt;git branch -d&lt;/code&gt; on the resulting list. On top of that, I also added &lt;code&gt;pad&lt;/code&gt; and &lt;code&gt;fad&lt;/code&gt; aliases that refer to pull or fetch and delete. Couple that with &lt;code&gt;--prune&lt;/code&gt; and I can keep my local Git repository and branches in check.&lt;/p&gt;

&lt;p&gt;Here's &lt;a href="https://gist.github.com/tswicegood/cd5495fd1e7b3e7efb8ea3b5c9c6610c"&gt;a gist&lt;/a&gt; with all of my aliases:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Hope you found this useful!&lt;/p&gt;

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