Yes, I do this while the dev branch is active. That’s how Anvil knows what the development schema is, because it’s stored in the source code.
The steps above bring the production database in sync with the development database. Merging the code is a separate step that happens either before or after the database merge, depending on what’s changed in the database.
Be sure you’re clicking the right buttons, though! You’ll use both, depending on which step you’re in.
I highly recommend playing with it in a test app.