What are the potential pitfalls of versioning a PHP project with GIT on a remote server accessed via FTP?

Potential pitfalls of versioning a PHP project with GIT on a remote server accessed via FTP include the lack of proper version control for the FTP server, potential conflicts between local and remote versions, and the inability to easily rollback changes. To solve this, consider using a deployment tool like GitFTP-Deploy or deploying via SSH instead of FTP.

// Example code snippet using GitFTP-Deploy for deploying PHP project via FTP
// Install GitFTP-Deploy via composer: composer require reconnix/gitftp-deploy
// Add GitFTP-Deploy configuration to .gitftp-deploy.yml file

require 'vendor/autoload.php';

use GitFTP\GitFTP;

$gitftp = new GitFTP();
$gitftp->deploy();