title: bash script to check if the current git branch = "x"
body: <p>I am very bad at shell scripting (with bash), I am looking for a way to 
  check if the current git branch is "x", and abort the script if it is not "x".</p>
  
  <pre><code>    #!/usr/bin/env bash
  
      CURRENT_BRANCH="$(git branch)"
      if [[ "$CURRENT_BRANCH" -ne "master" ]]; then
            echo "Aborting script because you are not on the master branch."
            return;      # I need to abort here!
      fi
  
      echo "foo"
  </code></pre>
  
  <p>but this is not quite right</p>