0

I am using GCP compute engine VM and VS code remote explorer SSH to the VM to write my code. How can I do git push/pull/add etc to GitHub private project inside the VM?

  • 2
    The same way you'd do them in a non-VM. You need ssh or https access to the GitHub repo, so that you can clone / fetch / push, and then you need to run Git commands. That's all there is to it. – torek Jul 15 '22 at 13:55

1 Answers1

0

If you are using HTTPS, make sure to define a git credential.helper to cache your credentials (like git config --global credential.helper "cache --timeout=36000" for instance)

If you had gcloud.sh configured, make sure it is limited to GCP repositories as documented here, or that helper would prevent you to access GitHub repositories.

That is why using SSH might be more convenient in this case.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250