1

During push I received an error, that my branch doesn't have an upstream branch

When I check the log I see that 2 latest commits are not situated in a separate branch. They seem to be commits to master:

$ git log --oneline --graph
* 41c580c [some message]
* ef2f219 [some message]
*   68db7f9 (master) [some message]
|\
| * f5c31f5 [some message]
* | b4c5864 [some message]
|/
* 7afc770 [some message]

But when I ask about git status, I see that I'm not in the 'master'. My branch is created and I'm in it:

$ git status
On branch [current_branch_name]

How could this happen and how can I fix this? I need to push 2 latest commits to the branch [current_branch_name]

dariaamir
  • 93
  • 1
  • 1
  • 3
  • 1
    The problem is not where the commits are or how the git branch was created. The problem is that your branch doesn't have an upstream branch. – matt Nov 04 '19 at 15:32
  • `git push -u master` should push it into the master branch of the remote. '-u' will record this relation ship for the future pushes. – Serge Nov 04 '19 at 18:19

0 Answers0