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 git remote add upstream ...
.
Then, I issued the git fetch upstream
. Followed by git checkout upstream/test1
. Now, if I type git branch -a
, I get an output like this:
* (HEAD detached at upstream/test1)
master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/upstream/test1
remotes/upstream/master
This is all fine, but then I did some changes to the code in my upstream/test1
branch, and I want to push them to origin/test1
repository, I get the error message on the title. Please note that I follow the steps below to push:
git add .
git commit -m "Sample message"
git push -u origin test1
If I issue git show-ref
, I get the following output:
refs/heads/master
refs/remotes/origin/HEAD
refs/remotes/origin/master
refs/remotes/upstream/test1
refs/remotes/upstream/master
I checked the following questions, but didn't find it helpful. Any ideas how to solve it?