Operation on Git merge with file removed

Bob Liu November 28, 2013

Hi

I use SourceTree to merge between branches. In master branch, FILE-A is changed, and in develop branch, FILE-A is removed. When I merge develop onto master. It will mark this file as conflict.

The question is

1. How to know this file is deleted in branch merged from or deleted in branch merged to? The only way is type "git status" in terminal, it will show "deleted by them" or "deleted by us". I don't know how to get this information from GUI.

2. When I select "Resolve Using Theirs", the file will remain unchanged, not be deleted as I expected. The only way is remove the file by selecting "Remove". It is difficult when there is many conflicts. Now, I must select each file to see if this file is deleted, and do "Add" or "Remove" for each of those files. Then I can resolve remain conflicts with "Resolve Using Theirs" or "Resolve Using Mine". Is there a express way to do this?

Thanks!

7 answers

3 votes
Russ Bishop March 3, 2014

I have noticed the same issue (Windows version). If a file changed on one branch and was removed on another, the GUI doesn't really indicate that, it just shows those files in the working copy changes area with the exclamation icon (next to other files that have actual merge conflicts so they are visually identical). On the right, you just see "Unmodified file" and no info.

Trying to resolve the conflict just throws up error dialogs, where I would expect selecting Resolve -> Resolve using theirs would mark the file as Removed. I would also expect a different icon and some info on the right-hand pane indicating explicitly that the conflict is due to a modified file being removed.

It would be a huge UI improvement to have some buttons on the right-hand side or somewhere that show up in a merge situation and make it obvious what your possible actions are (diff tool, take theirs, take mine) and context-aware so in this case the actions could be "take my changes, take theirs (remove file)"

Caue Rego April 27, 2014

-1 Good info, but not an answer.

Russ Bishop April 28, 2014

Thanks for letting me know I should avoid ever participating here because there are apparently a bunch of jackasses running around downvoting.

Like mikeybeck likes this
2 votes
Andreas Kasparek April 27, 2014

I had opened a Jira bug ticket for that: https://jira.atlassian.com/browse/SRCTREEWIN-1417

Caue Rego April 27, 2014

Awesome! Everyone from here, go there and vote up the issue! :D

1 vote
D K April 24, 2014

Hi,

Is there any fix for this. Or JIRA raised?

Caue Rego April 27, 2014

-1 not an answer, dude.

D K April 28, 2014

But I'd assume the answer is to add a feature request to JIRA and get questions 1 & 2 addressed!

0 votes
majkilde August 31, 2014

We see this problem a lot when using Source Control on Lotus Notes databases (XPages development). Notes has a funny way to handle metadata....

If SourceTree could just mark 'COnflicts with deletions' in the view?

0 votes
Caue Rego December 3, 2013

I would say those are big issues indeed, just tried it! :-o

If there is a merge conflict with a deleted file, I also can't tell on file status what happened. Even calling an external diff is disabled! O_o

And "Resolve Using Theirs" didn't delete the file as it should have!

Quite broken stuff there. I'd advice using command line or another tool for now, though for mac there aren't that many options.

0 votes
Bob Liu November 28, 2013

It is for Mac

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2013

Hi Bob. Is this for Mac or Windows?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events