Hi there,
If you run your runbooks and the git commands in Azure sandbox, it will be failed if it's not a part of custom powershell modules.
Basically, there is 2 options:
1) create your custom module with the git and import it to Azure Automation (I'm not sure that this will work in Azure Automation sandboxes at all)
2) create a VM with Hybrid Worker role, install git into the VM, run your runbooks in the HRW server