Applicable to:
- Plesk for Linux
Question
Is it possible to commit changes made in Plesk to a remote Git repository? e.g. perform git push
from Plesk to GitHub or BitBucket.
Answer
The Git extension for Plesk is only able to deploy files from a remote repo into the local Plesk repo, but not the other way around and that is so by design.
A feature that would let you commit changes from the Plesk server to the git repo is not yet available for this extension, however such a feature request has already been made and you may view and vote for it on the following link:
Git extension deploy using git's own worktree – Your Ideas for Plesk
Until such a feature does become available via the extension, as a workaround, you may use the following native commands for git in order to push changes to the git repo that is used.
Warning: The steps below will allow Git commands to be used, however they have not been tested extensively, due to which they are unsupported and should be applied only at your own will and risk.
-
In Plesk > Domains > example.com > Hosting & DNS > Web Hosting Access, change SSH access to
/bin/bash
for the site user: -
Log into the server via SSH as the site user (replace
jdoe
with the system user). This can be done from Tools & Settings > SSH Terminal:# su -l jdoe
-
Set up the Git preferences (this needs to be done only once):
# git config --global user.email "jdoe@example.com"git config --global user.name "John Doe"
-
With the preferences setup done, you should be able to push the changes manually by using the commands in the following example (replace the
example
as necessary):# git --git-dir ./git/example.git --work-tree ./httpdocs/example add --all
# git --git-dir ./git/example.git --work-tree ./httpdocs/example commit -m "comment"
# git --git-dir ./git/example.git --work-tree ./httpdocs/example push
Comments
0 comments
Please sign in to leave a comment.