title: How to parametrize git checkout using bash script
body: <p>I have directory with project sharing multiple versions and I've tried creating simple script that would checkout proper versions for every module with configuration is seperate files (2.6 is one of those).</p>
  
  <p>Config files look like:</p>
  
  <pre><code>&lt;module_name1&gt; &lt;branch_name1&gt;
  &lt;module_name2&gt; &lt;branch_name2&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <p>Edited</p>
  
  <pre><code>while read path branch;
  do
    cd $path
    echo
    echo $path
    echo "$branch"
    git checkout "$branch"
    cd ..
  done &lt; 2.6
  </code></pre>
  
  <p>Unfortunately git does not seem to recognize branch names passed this way resulting in error:</p>
  
  <blockquote>
    <p>' did not match any file(s) known to git.</p>
  </blockquote>
  
  <p>I'd like an advice how can I fix such script, or create it in another way? </p>
  
  <p>(or maybe some tool for configurable mass checkouting?...)</p>
  
  <p>EDIT:</p>
  
  <p>After some testing, it seems that git considers value passed by '$branch' as an empty string (I've checked it's content earlier with echo)</p>