On Thu, 2 Jun 2016 06:52:33 -0700 (PDT)
Craig Boldy <craigbold...@gmail.com> wrote:

> Yes I have ssh access and git is also installed.

Well, OK, so there are two parts to this: a simple one and
a complex one.

The simple one is that serving Git repos on an SSH-enabled machine
is a no-brainer.  Basically you do:

  $ ssh me@myserver
  % mkdir -p ~/git/
  % git init --bare ~/git/repo.git
  % logout
  $ cd ~/devel/myproject
  $ git remote add prod ssh://me@myserver/~/git/repo.git
  $ git push prod master

The complex one is that the scenario I outlined above has two

* The remote repository is owned by your account on the server
  (and we explicitly initialized it under your home directory).

  Though real websites are typically served by a process using
  a dedicated system user account (such as "www-data" or "apache").

  Hence the files in your "/var/www/domainname.com/files" are typically
  owned by that user, and most of them are read-only for that user --
  except for "volatile" directories such as "tmp", "cache", "uploads"
  and so on.

  As you can see, pushing is not enough as you need to somehow gateway
  the data between the repository on the server and the place from
  where the webserves reads them.

* Deploying is harder than that anyway.

  Say, Git does not track file permissions (other than the executable
  bit) and often you need to have specific owner+group and permission
  bits on your files.

  Sometimes, you need to drop the caches created by your website engine.

  There's also the question of what to do with the files locally
  modified on the server when the new project state "arrives".

Hence I'd recommend you to deal with this problem piecemeal:

1) Create a bare repository on the server and play with pushing
   to it / fetching from it so that you understand how the whole
   thing works.

2) Google for the keywords git+push+deploy, inspect the opinions
   presented in various resources you'll find, and pick whatever
   works for you.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to