Git - Merge only conflicted files

Asked

Viewed 344 times

0

Good afternoon!

Is there any way to merge between two branchs only in files with conflicts?

I am in a situation where we work with Azure and when doing a Pull Request she notifies that there are conflicts in two specific files. I usually update the two branchs locally and do the "checkout" of the files listed with conflicts.

But I wonder if there is any way to do it already messes with the files conflicted locally (without having to describe which files I want to merge)

Sincerely yours

1 answer

2

I’m not sure I understand the question but come on, in git when you give the command

git checkout sua_branch

git merge master

to merge your branch with the master in the case. If you have conflict the following message will appear

Auto-merging arquivo.ext
CONFLICT (content): Merge conflict in arquivo.ext
Automatic merge failed; fix conflicts and then commit the result.

in this case you tidy up the conflicts in the files and give the following command

git add arquivo.ext
git commit -m "correção do conflito..."

should appear the message

Recorded resolution for 'arquivo.ext'.
[sua_branch 645c4e6] Merged master fixed conflict.

then just follow the flow

Browser other questions tagged

You are not signed in. Login or sign up in order to post.