From some answers I found(example), I understand that if I do git push
, only the current branch commits will be pushed. However when I type 'git push`, I get the following output (partial):
. . .
Writing objects: 100% (12/12), 999 bytes | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
To https://gitlab.bla-bla.git
773f335..db28181 doedev_userAgentTest -> doedev_userAgentTest
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://gitlab.bla-bla.git'
. . .
My current branch is doedev_userAgentTest
:
$ git status
On branch doedev_userAgentTest
So what I understand from the above output is that the commits to the current branch were made correctly (I confirmed that the file I have committed is actually in the remote repo) but there was an attempt to push master branch and it failed.
So my questions are (disregard the error while pushing to master):
- Am I right in my assumption that there was a push to master made despite the fact I was pushing while on different branch?
- If the answer is yes, how do I push only from current branch?
NOTE: I do have all the above-mentioned branches remotely.