GIT – How to make a branch be the same as master

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)