git @ PL

   gitfs  +  gitium

How stuff works?

backend

backend

backend

backend

data

backend

data

backend

data

sftp

backend

data

sftp

backend

data

sftp

gitium

+

gitfs

backend

git.presslabs.net

sftp

git

 

git

 

backend

git.presslabs.net

sftp

Za problems

sync

backend

git.presslabs.net

sftp

gitium

for backend

gitfs

for sftp

backend

git.presslabs.net

sftp

gitium

gitfs

Git + WordPress = Love

Git + WordPress = Gitium

Gitum formula

3 x WordPress + 2 x Git

   plugins

   /    ||     \
   pull     wp     push
  \    ||     /
  themes

How to use git without learn it?

R: Use Gitium of course

Automatically

Track all of your code (plugins/themes) and see who changed what

Use all of this WordPress hooks:

  • upgrader_process_complete -> triggers the auto push
  • activated_plugin -> check for modifications
  • deactivated_plugin -> check for modifications
  • load-plugins.php -> check for plugin deletions
  • load-themes.php -> check for themes deletions
  • admin_enqueue_scripts -> plugin & theme editor page

How does git push the changes to wordpress?

R: by webhook 

Merge with accept MINE

merge conflicts

  • UD - unmerged, deleted by them
  • DD - unmerged, both modified
  • DU - unmerged, deleted by us
  • AA - unmerged, both added
  • UU - unmerged, both modified
  • AU - unmerged, added by us
  • UA - unmerged, added by them

Git + WordPress = Gitium

gitfs = fuse filesystem

gitfs <remote_url> <mount_point> -o <options>
tree
.
├── current
│   ├── alt.md
│   └── testing.md
└── history
    └── 2014-11-23
        ├── 20-00-21-d71d1579a7
        │   └── testing.md
        └── 20-42-32-7d09611d83
            ├── alt.md
            └── testing.md

history is read-only

current is not read-only*

  • git/
  • .gitignore
  • .gitmodules

read-only in current

need this for merge

always accept mine

if merge fails

read-only

fetch every 30s

push every 5 seconds *

if needed

if push.failed or fetch.failed:
    read_only = True

log_level: warning

log: syslog

/var/lib/gitfs/<instance_name>

all the defaults

http://www.presslabs.com/gitfs/docs/arguments/

git @ PL

By Vlad Temian