When I try to push to master I get:
remote: fatal error in commit_refs
How can I solve this?
Try rebase the current branch on top of the upstream branch after pull, e.g.
git pull origin master -r
then push it again:
git push origin master