Error: src refspec does not match any
<p>I have a project with a few friends in GitLab, and there is of course the master branch, and there are some others too. When I cloned the repository, I created also an upstream with the command <code>git remote add upstream ...</code>. </p>

<p>Then, I issued the <code>git fetch upstream</code>. Followed by <code>git checkout upstream/test1</code>. Now, if I type <code>git branch -a</code>, I get an output like this:</p>

<pre><code>* (HEAD detached at upstream/test1)
  master
  remotes/origin/HEAD -&gt; origin/master
  remotes/origin/master
  remotes/upstream/test1
  remotes/upstream/master
</code></pre>

<p>This is all fine, but then I did some changes to the code in my <code>upstream/test1</code> branch, and I want to push them to <code>origin/test1</code> repository, I get the error message on the title. Please note that I follow the steps below to push:</p>

<pre><code>git add .
git commit -m "Sample message"
git push -u origin test1
</code></pre>

<p>If I issue <code>git show-ref</code>, I get the following output:</p>

<pre><code>refs/heads/master
refs/remotes/origin/HEAD
refs/remotes/origin/master
refs/remotes/upstream/test1
refs/remotes/upstream/master
</code></pre>

<p>I checked the following <a href="https://stackoverflow.com/questions/21264738/error-src-refspec-master-does-not-match-any">questions</a>, but didn't find it helpful. Any ideas how to solve it?</p>