Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have to use <code>post-update</code> or <code>post-receive</code> hook; they are the ones that run after push to the repository completes. The only difference between them is how they get the arguments.</p> <p>Than I'd suggest using an ssh trigger to the production/staging server tu run a pull from there, because:</p> <ul> <li>You need to run some code there anyway, because push in git does not support checking the pushed version out on the remote end. So you'd need another hook there.</li> <li>Running a push there means allowing push access there and that means one more thing to secure. On the other hand the ssh trigger will have hardcoded branch to pull, so nobody can do any harm with it unless the central repository is also compromised and more importantly, even if it is, potential harm is only limited to tricking it to pull bad version, but no data can be deleted an no access to the rest of the computer may be gained.</li> </ul> <p>An ssh trigger is a script, that is associated with particular public key in ssh (prefix the public key in <code>.ssh/authorized_keys</code> with <code>command=</code><em>trigger</em>). When you log in with ssh using that key, ssh will ignore command provided by client and run the trigger. This limits possible damage when somebody steals the key, because the trigger can use it's own logic to know what to do and not accept any input from the client.</p> <p>Alternatively you can simply push and install appropriate hook to check out. See <a href="https://stackoverflow.com/questions/5703802/what-is-a-good-git-strategy-for-maintaining-source-code-on-www-hostingcompany-com">this question</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload