Pi-hole update errors

When trying to update your pi-hole installation with :

curl -sSL https://install.pi-hole.net | bash

Following error occurs : “Could not update local repository”. To resolve this, execute following commands :

cd /etc/.pihole
sudo git fetch --tags
sudo git reset --hard

and / or (depending when the error occurs)

cd /var/www/html/admin
sudo git fetch --tags
sudo git reset --hard

After that start update again