Articles in this section

How to commit and push website files to the local Plesk Git repository?

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux

Question

How to commit and push website files to the local Plesk Git repository?

Answer

  1. Log into Plesk;

  2. Create a new local Git repository in Plesk > Domains > example.com > Git > Add Repository:

    border_plus_2018-02-24_18_12_59-Add_Git_Repository_-_Plesk_Onyx_17.5.3.png

  3. Connect to the server via SSH;

  4. Navigate to the subscription's directory:

    # cd /var/www/vhosts/example.com

  5. Add website's files to the repository and comit the changes:

    # git --git-dir ./git/example.git --work-tree ./httpdocs add --all

    # git --git-dir ./git/example.git --work-tree ./httpdocs commit -m 'Initial commit'

    Note: Where example.git is the name of the local repository created on step 2.

  6. Restore correct permissions as system user of the subscription:

    # chown -R $(plesk db -Ne 'select s.login from domains d, hosting h, sys_users s WHERE s.id=h.sys_user_id AND h.dom_id=d.id AND d.name="example.com"'):psacln ./git

  7. Navigate to Plesk > Domains > example.com > Git and select master branch in Change branch and path:

    border_plus_2018-02-24_18_20_06-Git_Repositories_on_chtulhu.faith_-_Plesk_Onyx_17.5.3.png

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.