How to Merge a Feature Branch that Completely Changes the Project Structure
Wednesday, December 2, 2020
How to Merge a Feature Branch that Completely Changes the Project Structure
I recently updated my site from Jekyll to Scully. These are, obviously, two entirely different frameworks and project types. There was no easy way to merge my scully
branch into the master
branch. I found a StackOverflow answer though that helped me out. Essentially, you can merge master
into your branch with a flag setting the strategy to ours
. That means that any differences between master
and scully
will be accepted in favor of scully
. After doing that merge, I checked out the master
branch and merged scully
into master
. Because I had a PR already opened, this also closed my PR.
In short, here's the way to do this:
git checkout master && git pull origin master
git checkout scully
git merge -s ours master
git checkout master
git merge scully
Like I said, if you have a PR open for this, it will close the PR. And your project will now match whatever the project structure looked like on the scully
branch.
Code Examples
Terminal
Have a question or comment?