title: git push - How to fix Error remote: fatal: bad object HEAD?
body: <p>I did clone a master branch, created a new branch and made changes, commit and try to push using the following command:</p>
  
  <p><strong><code>git push origin myNewBranch</code></strong>, but I keep getting the following error:</p>
  
  <pre><code>remote: fatal: bad object HEAD
  To https://gitlab.com/myProjectRepo/my-app.git
   ! [remote rejected] myNewBranch -&gt; myNewBranch (missing necessary objects)
  error: failed to push some refs to 'https://gitlab.com/myProjectRepo/my-app.git'
  </code></pre>
  
  <p>The error I get doesn't mention or point to any empty object file like <a href="https://stackoverflow.com/questions/11706215/how-to-fix-git-error-object-file-is-empty">asked here</a>. And also it happens from my side when trying to <code>push</code> not <code>commit</code></p>