0

I have a master branch and a development branch. I'm currently in my development branch.

When I do git push I get the following suggestions:

fatal: The upstream branch of your current branch does not match the name of your current branch.  To push to the upstream branch on the remote, use
git push origin HEAD:master

To push to the branch of the same name on the remote, use
git push origin development

So I type git push origin development to push to the development branch. But I simple want to type git push to push to the current branch (development).

When I type git status I get this message:

Your branch is ahead of 'origin/master' by 26 commits.

So I did a pull request from development to master and merge the development branch into the master branch. But I still get the message "Your branch is ahead of ... ".

What am I doing wrong over here?

Thanks

Liam
  • 27,717
  • 28
  • 128
  • 190
Dennis
  • 528
  • 3
  • 24

1 Answers1

2

When you created your development branch you somehow set it to track origin/master instead of origin/development.

Run git branch -vv to see your branches and which upstream branches they are tracking.

You can correct the upstream setting for the development branch with:

git branch --set-upstream-to=origin/development development
Duncan
  • 92,073
  • 11
  • 122
  • 156
  • Thank you for your quick reply. – Dennis Nov 28 '18 at 10:08
  • What does it actually mean if the track is set to origin/master ? @Duncan – Dennis Nov 28 '18 at 12:01
  • 1
    @DennisPerremans: for information about a branch's upstream setting, see https://stackoverflow.com/questions/17122245/what-is-a-git-upstream or my rather long answer to https://stackoverflow.com/questions/42328493/why-do-i-have-to-set-upstream-of-new-branch-i-create-locally – torek Nov 28 '18 at 15:52