title: How to iterate through all git branches using bash script
body: <p>How can I iterate through all the local branches in my repository using bash script.
  I need to iterate and check is there any difference between the branch and some remote branches.
  Ex</p>
  
  <pre><code>for branch in $(git branch); 
  do
      git log --oneline $branch ^remotes/origin/master;
  done
  </code></pre>
  
  <p>I need to do something like given above, but the issue I'm facing is $(git branch) gives me the folders inside the repository folder along with the branches present in the repository.</p>
  
  <p>Is this the correct way to solve this issue? Or is there another way to do it?</p>
  
  <p>Thank you</p>