Gitlab website merge request: git push origin master "everything is up to date"

Viewed 764

I'm merging my created branch to master. I'm creating new merge request through gitlab website, I get used using GUI than commandline so I thought using gitlab website is ok. After creating the merge request, there's merge conflict.

Then I merge locally using the guide from gitlab website

git fetch origin
git checkout -b otpreflow origin/otpreflow
git fetch origin
git checkout origin/master
git merge --no-ff otpreflow

then I merge the conflicted file, after that

git add .
git commit -m "merge conflict"
git push origin master

and then it says Everything is up to date

shouldn't it pushed to master? I checked in gitlab website, it is not yet merged.

Yes, there are many question with the title git push everything is up to date I already read many of them, I think many of the the problem is different thus I titled my question a bit different, hopes not to confuse the future reader in case this question is solved.

update: running git brach -avv outputs * (HEAD detached from origin/master) 836cf0c6 merge request

1 Answers

Why you have checkout to origin/master. It is an remote branch which reference remote and is not editable only on update from network connections by git.

It will only update when you fetch data from remote.

So when you checkout to it, it checkout you to a commit id and when you merge new branch into commit, merging happens but master reference on local is not updated, so "Everything is up to date".

Follow this series and it will work:

git fetch origin
git checkout -b otpreflow origin/otpreflow
git fetch origin
#instead of origin/master make it master
git checkout master 
git merge --no-ff otpreflow

Thanks

Related