title: Setting an alias within an alias
body: <p>I am trying to be able do something like this:</p>
  
  <pre><code>&gt; function gitb(){ git checkout -b $1; alias $1='git checkout $1'; }
  &gt; gitb sample
  Switched to a new branch 'sample'
  &gt; git checkout master
  Switched to branch 'master'
  &gt; sample
  Switched to branch 'sample'
  </code></pre>
  
  <p>But, the function gitb doesn't behave as expected because:</p>
  
  <pre><code>&gt; alias sample
  alias sample='git checkout $1'
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>&gt; alias sample
  alias sample='git checkout sample'
  </code></pre>
  
  <p>Can anybody tell me how to achieve what I am trying to?</p>