<?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: Vlastimil Pospichal</title>
    <description>The latest articles on DEV Community by Vlastimil Pospichal (@vlasales).</description>
    <link>https://dev.to/vlasales</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%2F81874%2F9e46d678-b4a4-4493-b8a3-af379d783a81.jpeg</url>
      <title>DEV Community: Vlastimil Pospichal</title>
      <link>https://dev.to/vlasales</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vlasales"/>
    <language>en</language>
    <item>
      <title>Git Prompt in Bash</title>
      <dc:creator>Vlastimil Pospichal</dc:creator>
      <pubDate>Fri, 19 Oct 2018 00:34:33 +0000</pubDate>
      <link>https://dev.to/vlasales/git-prompt-in-bash-47ph</link>
      <guid>https://dev.to/vlasales/git-prompt-in-bash-47ph</guid>
      <description>&lt;h2&gt;
  
  
  All in one picture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftn0eobf89obciofgg9fi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftn0eobf89obciofgg9fi.png" alt="Screenshot of use" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Source code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ~/.bashrc

__git_status() {
    STATUS=$(git status 2&amp;gt;/dev/null |
    awk '
    /^On branch / {printf($3)}
    /^You are currently rebasing/ {printf("rebasing %s", $6)}
    /^Initial commit/ {printf(" (init)")}
    /^Untracked files/ {printf("|+")}
    /^Changes not staged / {printf("|?")}
    /^Changes to be committed/ {printf("|*")}
    /^Your branch is ahead of/ {printf("|^")}
    ')
    if [ -n "$STATUS" ]; then
        echo -ne " [$STATUS]"
    fi
}

PS1='\[\033[07;33;01m\]\n\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_status)\$ '
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all folks!&lt;/p&gt;

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