title: Shell: Git Repo Creation Script is NOT Pushing Remote Upstream
body: <p>Below I have a shell script that is not pushing it's created remote branches upstream.</p>
  
  <p>I tested the script locally and found that the branches are indeed being created however, it seems to break once the script reaches the line <code>git push -u origin master</code></p>
  
  <p>If anyone can point out what I'm doing wrong it will be much appreciated. </p>
  
  <pre><code>#!/bin/sh
  set +x
  localPath=$HOME/repos
  token=""
  instance=https://gitlab.####.com/api/v4
  namespace_id=2 #This is the Flag group on our Gitlab instance. 
  
  # On first use, prompt user to input the Gitlab Private API token. Then, store it for future uses as token.txt. 
  if [ -f token.txt ]
      then
      read token &lt; token.txt
  else 
      read -p "Please input your Gitlab Private API Token from your user profile (https://gitlab.####.com/profile/account): " token
      echo $token &gt; token.txt
      $token &lt; token.txt
  fi
  
  for eachRepoName
      do
          #Local Work
          mkdir -p $localPath
          mkdir -p $localPath/$eachRepoName
          cp Master-Ignore-List.txt $localPath/$eachRepoName/.gitignore
          cd $localPath/$eachRepoName/
          echo "pre-git"
          git init
          touch README.md
          git add README.md .gitignore
          echo "about to commit"
          git commit -m "First Commit"
          #End Local Work
  
          curl -w "%{http_code}\n" --header "PRIVATE-TOKEN: $token" -X POST "$instance/projects?name=$eachRepoName&amp;namespace_id=$namespace_id"
  
          git remote add origin https://gitlab.####.com/flag/$eachRepoName.git
          git push -u origin master
          git checkout -b development
          git push -u origin development 
          git remote set-head origin master 
          git branch -a
      done
  </code></pre>