It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to merge an already (partly) merged branch?

Hi all,

This is a bit of a complex problem but I'll try to keep it short.

I merged a branch (lets call it X) into my working branch (lets call it Y). Now, unfortunately for me I have to go through each file from X and check if it's 'safe' to use - discarding chunks from certain files, keeping other lines, etc.

While working on Y -- through Sourcetree -- I have been staging files and committing (and pushing) once I know they are 'safe'. So I have a remote and local branch (Y) that is now almost completely good to go.

Then something bad happened and I removed the remaining 'yet to be cleaned / checked' files from my unstaged changes and restarted Sourcetree - I did this thinking that when I remerged X, it would detect that Y had already accepted most of X's files (or that I hade made changes -- making them more up to date than X) and display those remaining files that had yet to be staged from before. This did not happen.

I now have all the changes I have 'cleaned' / saved and committed, but remerging X does nothing - Sourcetree seems not to recognize that X and Y still have differences and that Y doesn't have newer / more up to date files than X (in some cases).

This is despite the fact that running git diff X..Y shows all the differences I need to track!!!!

Please help
Foxy

1 answer

Okay I managed to figure this out... mostly by accident haha.

So since my current 'remote' and working copy branch (Y) had all the changes I wanted, I reset branch Y to a state PRE merge with X, but as 'mixed' (keep working copy changes).

This allowed me to just re-commit the working copy changes to Y and then merge from X (had to do a force push to update the remote branch Y but this was no biggie). The remaining files (which I had yet to clean) now appeared again, letting me finish my days work.

If anyone else has this issue, this will hopefully solve it for you too.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

627 views 0 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you