Push rejection (Git)

Reason:
If you have updated a local branch and then trying to push it on remote you may got the following error:

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

This happens if someone else has done parallel changes on this branch and pushed it before you did.

Solution:
Bring your local branch up to date with the remote one, which removes all your local changes on it.

git fetch origin
git reset --hard origin/<branch>

Then you have to do your local changes again and afterwards you can try to push it again.

That’s a reason for the usage of feature branches, cause all you have to do again is rebase and merge.