<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Git on Sandro Cirulli</title>
    <link>https://sandrocirulli.net/tags/git/</link>
    <description>Recent content in Git on Sandro Cirulli</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Sun, 29 Jan 2017 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sandrocirulli.net/tags/git/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Delete a Branch in Git</title>
      <link>https://sandrocirulli.net/how-to-delete-a-branch-in-git/</link>
      <pubDate>Sun, 29 Jan 2017 00:00:00 +0000</pubDate>
      <guid>https://sandrocirulli.net/how-to-delete-a-branch-in-git/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;../../img/Git-logo.svg&#34;&#xA;    alt=&#34;Git logo&#34; width=&#34;500&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&#xA;          &lt;a href=&#34;https://en.wikipedia.org/wiki/Git#/media/File:Git-logo.svg&#34;&gt;Image: Jason Long CC BY 3.0&lt;/a&gt;&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Git encourages branching but sometimes you need to do a clean up and delete merged or orphaned branches from your local and remote repositories. Here is the procedure from the command line.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;To delete a branch locally&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git branch -d branchname&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may get an error like this one if the branch has not been merged yet:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;error: The branch &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;branchname&amp;#39;&lt;/span&gt; is not fully merged.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;If you are sure you want to delete it, run &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;git branch -D branchname&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is a good reminder in case you are deleting something you should not be deleting.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
