I have a website using git
The setup has the master branch as the live site and a develop branch as the dev domain which is used for testing features before they go live
No work is ever done directly on master or develop, it's always done on feature branches and then merged in to develop for testing, followed by master to go live
My issue is that I have one site which has had a lot of work merged in to the develop branch which is never going to go live
I've been asked to make the develop branch match the master branch to ensure the work that's never going live doesn't affect the testing of other new features that get merged in to develop
I've done a bit of research and from my understanding, I can't use rebase as that's more for updating a branch with commits made since you branched off
The only option that seems to do what I need is to rename the develop branch and then recreate it from master and force a push to update it remotely
Is this my best option? Or is there another way I don't know about? Or maybe rebase is correct but I'm not quite understanding its purpose?
Thanks in advance
GitHub took action based on the Conservancy's suggestion and moved away from the term master when a Git repository is initialized, "We support and encourage projects to switch to branch names that are meaningful and inclusive, and we'll be adding features to Git to make it even easier to use a different default for new ...
If you don't care about preserving develop just checkout develop
and reset it to master
or main
or whatever you/ your team named your default branch.
# make sure the default branch is up to date before you do this
git checkout develop
git reset --hard master # replace with your name if it differs
git push -f # force push the branch
This is often done for an integration
branch every morning, so that the nightly integration is always based on master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With