How to push after merge back to master?

I wanted to merge a branch into master and followed the steps gitlab told me to do.

  1. git fetch origin
  2. git checkout -b "testbranch" "origin/testbranch"
  3. git fetch origin
  4. git checkout "origin/master"
  5. git merge –no-ff "testbranch"
  6. Here I fixed all the conflicts
  7. git commit -m "merged"
  8. git push origin "master"

The problem is that when trying to push to master it will say that it is already uptodate. Also the git console doesn’t say that I am on the master branche but on some number "61684d2…".

How can I push my changes back to master?

>Solution :

When you do git checkout origin/master, you are starting to run locally from a remote branch…. this is on detached HEAD state. If this is really the way you merge/push, then you need to specify where to push when pushing:

git push origin @:master

Leave a Reply