<?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: Jun Sumida</title>
    <description>The latest articles on DEV Community by Jun Sumida (@junsumida).</description>
    <link>https://dev.to/junsumida</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%2F87532%2Fbac1486b-60d0-4a73-9c85-ed6c13e509ac.jpeg</url>
      <title>DEV Community: Jun Sumida</title>
      <link>https://dev.to/junsumida</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/junsumida"/>
    <language>en</language>
    <item>
      <title>あまり汎用的じゃないgitのtips</title>
      <dc:creator>Jun Sumida</dc:creator>
      <pubDate>Wed, 25 Mar 2020 16:52:18 +0000</pubDate>
      <link>https://dev.to/junsumida/git-tips-in2</link>
      <guid>https://dev.to/junsumida/git-tips-in2</guid>
      <description>&lt;h3&gt;
  
  
  upstreamにmergeされているbranchを全て削除
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git branch | xargs git branch -d
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  untracked filesを一括削除
&lt;/h3&gt;

&lt;p&gt;本当に全部消えるので注意&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git clean -fdx
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  特定のディレクトリにある最新のcommit hashを確認
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;cd ~/git/something_special &amp;amp;&amp;amp; git log -1 | cat - | grep commit
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  特定のlocal branch以外全てのbranchを削除する
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git branch | grep -v branch_name | xargs git branch -D
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  特定の単語を含むbranchを削除
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;git branch | grep fix- | awk '{print $&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;' | xargs git branch -D
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  2つのbranch間の同じファイルでdiffを取る
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git diff master feature_branch_a file_to_be_compared.txt
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  2つのbranch間で別名のファイルでdiffを取る
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git diff master:old.txt feature_branch_a:new.txt
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  remote branchの削除
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git fetch --prune
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
    </item>
    <item>
      <title>useful ssh-keygen tips</title>
      <dc:creator>Jun Sumida</dc:creator>
      <pubDate>Wed, 25 Mar 2020 16:51:06 +0000</pubDate>
      <link>https://dev.to/junsumida/useful-ssh-keygen-tips-55no</link>
      <guid>https://dev.to/junsumida/useful-ssh-keygen-tips-55no</guid>
      <description>&lt;h2&gt;
  
  
  generates a public key from a secret key
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -y -f ~/.ssh/id_rsa &amp;gt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  generates fingerprints from a public key
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  changing passphrase
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -p -f ~/.ssh/ssh_key.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>sshkeygen</category>
    </item>
    <item>
      <title>some docker tips to delete containers and images</title>
      <dc:creator>Jun Sumida</dc:creator>
      <pubDate>Wed, 25 Mar 2020 16:44:25 +0000</pubDate>
      <link>https://dev.to/junsumida/some-docker-tips-to-delete-containers-and-images-35e3</link>
      <guid>https://dev.to/junsumida/some-docker-tips-to-delete-containers-and-images-35e3</guid>
      <description>&lt;h4&gt;
  
  
  deleting all the stopped containers
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;docker rm `docker ps -a -q`
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  deleting all the stopped containers except for recent 5 containers
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;docker ps -a -q | sed 1,5d | awk '{print $&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;' | xargs --no-run-if-empty docker rm
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  deleting all the containers used more than 1 week ago
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;docker ps -a | grep -v 'hours ago' | grep -v 'days ago' | awk '{print $&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;' | xargs --no-run-if-empty docker rm
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  deleting docker images which REPOSITORY and TAG is none
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;docker images | grep none | awk '{print $&lt;/span&gt;3&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="s1"&gt;' | xargs docker rmi
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>docker</category>
    </item>
  </channel>
</rss>
