I have a private Git repo at BitBucket with a simple structure. Master is for releases, there is a dev branch that occasionally gets merged up to that. There are two or more branches from dev for individuals. I'm using the latest Tortoise Git but can use gitbash or other tools. We follow this pattern

Fetch from dev, create branch mybranch, change/commit/change/commit, push. Change to dev, merge+squash recent commits from mybranch, commit, push.

That seems to work. The mybranch and dev branches both show what's expected.

Next : In mybranch, rename a folder, commit, push. Then attempt to merge that change into dev: Change to dev, merge+squash recent commits from mybranch. This results in a conflict.

I don't understand why this is a special case or how to resolve it. It doesn't see the renamed directory as a delete and an add. When there are a few files that have been moved or renamed like this, the local dev branch gets partially updated and ends up in a useless state of partial updates.

I've tried many ways to rebase, clean, re-clone, abort the merge, and otherwise go back to a clean pull of dev so that I can re-attempt the merge of one or more commits from mybranch. I've tried to cherry-pick just the one commit from mybranch into dev and still goes into this weird state.

I know conflicts can happen if someone updates a branch (dev) with similar changes after I've pushed mybranch and then I retry an update that has conflicting changes. That's not this scenario. For this scenario I'm the only one who has been updating dev and mybranch.

I'm sure I can eventually figure out how to get individual changes to sync up between dev and mybranch. In fact, given the pattern, and that I've been the only one to recently update dev, I could easily just force a push of mybranch onto dev and it will have everything it should.

But I want to understand why this is so FUBAR. Am I dealing with a known bug? Am I not following the correct pattern? I'll accept RTFM but I need to know exactly what I'm missing. Thanks.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.