Skip to content

Instantly share code, notes, and snippets.

@dattasaurabh82
Created July 18, 2024 04:31
Show Gist options
  • Save dattasaurabh82/62b26c79d40bbe2b3892e025239e96cd to your computer and use it in GitHub Desktop.
Save dattasaurabh82/62b26c79d40bbe2b3892e025239e96cd to your computer and use it in GitHub Desktop.
git merge main from dev -- ignoring all changes

To make the main branch exactly like the dev branch by ignoring the changes in the main branch and overwriting it with dev:

git fetch origin

Check out to the main branch:

git checkout main

Reset the main branch to match the dev branch:

git reset --hard origin/dev

Force push the changes to the remote main branch:

git push origin main --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment