simply browse to directory which you are looking to update this can be an OCA repo or any other repo cloned using git.
lets update odoo base
cd /opt/odoo15/odoo "odoo folder"
then issue the command
sudo git fetch origin 15.0
sudo git reset --hard origin/15.0