I want to give a GCP VM access to Cloud Source Repository but without having to shutdown the VM because I have some processes running. Is this possible or I need to wait until the processes are done, turn off the VM and grant the permissions needed? How can I achieve this? Sorry for the naive question, I'm still learning how to use well GCP products :(.
You can go to IAM & Admin > IAM and look for the service account used by your Compute Engine instance. If you're using the default service account, this is the format:
PROJECTNUMBER-compute@developer.gserviceaccount.com
Afterwards, click "Edit Member" then select a role and look for "Source". You should be able to see these following roles:
Select which role is best for your use case then hit save.