title: git: error: src refspec main does not match any
body: <p>I was trying to use git via VSCode, and because I didn't know how to use Git on VSCode, it messed up everything.<br />
  Then I tried to use CMD (Windows) as usual. I am learning, and I've never seen this kind of error before, so I don't know how to solve this.</p>
  <p>But it's showing these errors when I try to push to the main branch:</p>
  <pre><code>error: src refspec main does not match any
  error: failed to push some refs to 'myPathToRepo'
  </code></pre>
  <p>I tried:</p>
  <ul>
  <li>I tried with another branch and it was working fine but I want to use the main branch</li>
  <li>I even tried deleting the git folder and initiating it again</li>
  </ul>
  <p>I've seen other posts on StackOverflow and mostly they say &quot;first commit and then push because this error arises when you're pushing without committing&quot;.</p>
  <p>After deleting the <code>.git/</code> folder and restarting, it starts to show this same error</p>
  <pre><code>&gt;git push
  fatal: The current branch master has no upstream branch.
  To push the current branch and set the remote as upstream, use
  
      git push --set-upstream origin master
  
  &gt;git push -u origin main
  error: src refspec main does not match any
  error: failed to push some refs to 'myPathToRepo'
  </code></pre>
  <p>This is my first commit:</p>
  <pre><code>[master (root-commit) 061a06e] first commit
  </code></pre>
  <p>PS. I only have 'main' branch.</p>
  <p>Commands that I ran:</p>
  <pre><code>git init
  git remote add origin 'pathToMyRepo'
  git add -A
  git commit -m &quot;first commit&quot;
  git push
  git push -u origin main
  </code></pre>
  <p>Please help.</p>