Reputation: 1198
Firstly, please let me say that I am well aware that our setup is not "correct" or ideal, but this is how it has been done. I currently have...
dev
or redesign
) checked out in one folder.master
branchmaster
branchWhen developing, I usually make changes in the dev
branch, then when happy, merge them into the master
locally, then push to our local git server and pull from that on our web server.
We then decided to overhaul the interface of our application, so created the redesign
branch from the current dev
branch. Since then, a whole host of changes have been made in the redesign
branch and now I need that branch to essentially become the master
. The dev
branch can be overwritten with everything in redesign
, but it would be ideal to keep the commit history for it if possible.
Being a somewhat inexperienced git user, please can somebody tell me the best process/commands to do this? I am thinking I need to "simply" merge my changes from redesign
into dev
, then do as I usually do, merging dev
into master
etc. I usually use Sourcetree, but can use CLI if easier.
Thanks!
Upvotes: -1
Views: 42
Reputation: 312263
I'm not familiar with sourcetree, so I can't address that part of your question, but using git
that procedure would be:
# switch to the dev branch
git checkout dev
# merge in the changes from the redesign branch
git merge redesign
# switch to the master branch
git checkout master
# merge in the changes from the dev branch, which at this point
# include the changes from the redesign branch
git merge dev
Upvotes: 1