• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question git pull from Github

Symer

New Pleskian
Server operating system version
Debian 11.9
Plesk version and microupdate number
Plesk Obsidian 18.0.60 Mise à jour 1
Hello everyone.
I'm new to my git / github.
I managed to install git on my PC, push to Github and have github send the information (webhook) to Plesk so that it pulls the commit.

But I have a question, is it possible to pull the FTP content that is present on Plesk from Github?

Indeed, I have a Prestashop site and sometimes if a module does not work the developer intervenes directly on the FTP. So I would like to pull his modifications to be able to see what he did and keep files up to date on Github?

Thanks in advance.

PS: Sorry for my English, it is translated from google translate.
 
The GIT extension can only be used to Pull from a remote repository (like Github).

If I understand correctly you sometime upload files manually to your website and want to Commit and Push those changes to your repository on Github? The GIT extension does not support Commits and Pushes. But you can do that via command line.
 
You understood my need exactly.
Would you have any information to send me on how to do this from the command line please?
 
Sure, but I highly recommend to create test repository in GitHub and add a test domain to Plesk to familiarize yourself with the Git command before you use any of these commands on your production site! Because if something goes wrong you might accidently break your website or mess-up your repository.

If you use the build-in Plesk SSH-terminal you use these commands. First get the name of the directory of your repository. In this example it's my-repo.
Schermafbeelding 2024-05-15 183533.png
Replace my-repo with your repository name in the commands bellow. Also I assume your repository has been deployed to the default document root directory (httpdocs). If it isn't change that too in the example bellow.

You probably first have to configure the user identity for your repository. Which you can do using these two commands:
Code:
git --git-dir=git/my-repo.git/ config user.email "[email protected]"
git --git-dir=git/my-repo.git/ config user.name "Your Name"

With the command below you add all new files in to the commit.
Code:
git --git-dir=git/my-repo.git/ --work-tree=httpdocs add --all

Next you commit the changes to repository with a message (replace commit message with your own message) and push the changes your remote repository.
Code:
git --git-dir=git/my-repo.git/ --work-tree=httpdocs commit -am "commit message"
git --git-dir=git/my-repo.git/ --work-tree=httpdocs push
 
Hello, thank you, it’s great, I’m going to try that.
To push to my remote repository, I add the url to this command?

git --git-dir=git/my-repo.git/ --work-tree=httpdocs push remote_repository ?
 
These commands only work if you have previously deployed your remote repository in Plesk. Your remote repository URL will be stored in the repository configuration. So no need to add the URL to any commands.
Schermafbeelding 2024-05-17 192326.png
 
Back
Top