My repo structure is like this.
Now my need is to make the 'master' code exactly same to 'dev'. I guess, a merge would cause the unwanted commits on 'master' to be retained. Any help?
You may do a hard reset on master
to the current dev
branch:
# from master
git checkout master
git reset --hard dev
But keep in mind that this may potentially discard any commits on master
which were unique to that branch. If this be a concern of yours, then consider branching off from master
as a safety precaution.
The next time you push master
to the remote you will probably have to force push:
git push --force origin master
The reason for force pushing is that you have rewritten the base of the master
branch and Git won't accept a regular push.
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