简体   繁体   中英

How to Install git in google compute engine?

I used bitnami stack to setup a new vm instance on Google compute engine. The stack had prestashop preinstalled with it. I would like to pull prestahop code localy, make changes and push live.
Should i install git on the instance manually?
In google console there is an option to connect a repository with github repository, this only works for google engine, not for compute? How can i install git or use any other service google provides for this instance and edit existing code?

I actually have a similar setup. I installed Bitnami's Redmine VM on google cloud compute.

Most Bitnami VMs come with git installed, but not all. So try this:

Login to your Google Cloud Instance.

then run (omitting the $ , of course):

$ which git

should display something like

/usr/bin/git

if not, run:

$ sudo apt-get update

Allow the update to run. Then run:

$ sudo apt-get install git

Allow the install to run. Now running:

$ which git

should return something like:

/usr/bin/git

Now, if you don't yet have a repository setup remotely go do that at www.github.com , www.bitbucket.com , or whatever service you use.

Now, go to /opt/bitnami/apps/[app-name]/htdocs on your VM:

$ cd /opt/bitnami/apps/[app-name]/htdocs

Then:

$ git init
$ git add .
$ git commit -m "initial commit"
$ git remote add origin <URL_TO_YOUR_REPO>
$ git push -u origin master

Now your instance files should be in your repo. You should now be able to clone and change locally, and pull changes on your Google Cloud VM.

Hope this helps. Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM