1

I have one instance (virtual machine linux google cloud console) and inside it in "var/www/" two folders on each one website. (for example foler1 and folder2) With ssh I downloaded a copy of one of those folders (folder1) to my local machine. The folder is already a git repository, now I want to be able to modify in local and then to upload the changes to the instance (vm) -> /var/www/folder1.

In fact, I need to know the workflow using git locally and upload my changes to a virtual machine (google cloud) in a specific folder inside "/var/www/" I've been really researching this process but I can't find anything in the tutorials.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Hugui Dugui
  • 13
  • 1
  • 3
  • Are you using any git server, either hosted by you or other provider? More info here: https://git-scm.com/book/en/v1/Git-on-the-Server – Jorge Plaza Jan 29 '17 at 14:41

2 Answers2

1

if your source code is version controlled in git, then just push your changes to git from your local system and then clone the git repo in the VM on google cloud.

you can have a look at Git for beginners: The definitive practical guide

Community
  • 1
  • 1
Satish
  • 1,037
  • 1
  • 13
  • 20
0

Well you can clone the git repository locally using the command git clone url-of-your-repository. In order to do this, you need to setup a git server on your virtual machine.

After you have cloned the repository to your local machine, you can push the changes back to your virtual machine using the command: git push origin master.

See this link for more information: https://git-scm.com/docs/user-manual.html

Nadir Latif
  • 3,690
  • 1
  • 15
  • 24