0

I know this could've been a question previously asked, but I am not sure it was answered properly. I am trying to fix merge conflicts when merging to the master branch. So what I did was, I checked out the master branch, did a git fetch, git pull, then checked out my feature branch, and fixed the merge conflicts I needed to fix.

Now, all the files I have fixed will need to be manually added, then committed, then pushed to the master branch. That, I understand. However, a lot of files showed up in the Changed to be committed section, that are already on the master branch, when I checked the git lab repo.

My question is, am I supposed to keep those and commit them alongside my changes? or should I remove them and just commit and push my changes?

I have tried following this After a Git merge conflict, a lot of files I didn't touch become changes to be committed, but I didn't find it pretty helpful.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Is your intention to setup a Merge Request to merge your feature branch into `master` in GitLab, or are you trying to merge it into `master` locally and push `master`? – TTT Oct 31 '22 at 02:59

1 Answers1

0

If you git diff each file to be commuted with the main branch you should see only your core changes, not the merged changes.

For example: if you are using a tool like IntelliJ, if you right click on an uncommitted file and git compare it with the main branch, only the “new changes” should be highlighted, the merged changes should not be.

user3304825
  • 107
  • 2
  • 12