Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading