I am quite new to git, and I had been working on a small side project for the last 2 months and had been pushing stuff onto bitbucket with no problems. A couple of days ago,
I had the same problem. I fixed by using the git push -f command which forces the update.
git push -f