You don't. And that's why people stop contributing to such projects and forks are created (see MariaDB). But that's not really a fault of the GPL. You could require contributors to agree to whatever you want regardless of the license you choose. Contributing to proprietary software (often as a result of an employment) sure comes with requirements other than the code itself.