Version control, also known as revision control or source control,[1] is the management of changes to documents, computer programs, large web sites, and other collections of information.
Changes are usually identified by a number or letter code, termed the "revision number", "revision level", or simply "revision"
For example, an initial set of files is "revision 1". When the first change is made, the resulting set is "revision 2", and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged.
Git was created by Linus Torvalds in 2005 for development of the Linux kernel
Torvalds sarcastically quipped about the name git (which means unpleasant person in British English slang):
"I'm an egotistical bastard, and I name all my projects after myself.
First 'Linux', now 'git'."
The man page describes Git as "the stupid content tracker".
That is, the construction of something that has an observable and tangible result
The term build may refer to the process by which source code is converted into a stand-alone form that can be run on a computer or to the form itself.
don't versioning the code of others
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
composer init
{ "name": "ilbonzo/wp-site", "type": "project", "require": {} }
Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works on my machine" excuse a relic of the past.
Vagrant support VirtualBox, Hyper-V, VMWare and Docker as provider
vagrant up
vagrant halt
vagrant ssh
vagrant destroy
Vagrant boxes
https://www.vagrantup.com/docs/boxes.htmlvagrant init beet/box vagrant up
mkdir -p site/web vagrant ssh sudo ln -s /vagrant/site/web /var/beetbox mysqladmin -u root password password
// site/index.php <?php phpinfo();
composer require johnpbloch/wordpress
"require": { "johnpbloch/wordpress": "^5.2" }
{ "name": "ilbonzo/wp-site", "type": "project", "config": { "vendor-dir": "web/content/vendor" }, "extra": { "wordpress-install-dir": "web/wp" }, "require": { "johnpbloch/wordpress": "^5.2" } }
// wp-config.php <?php // Load Composer’s autoloader require_once (__DIR__.'/../content/vendor/autoload.php'); // Move the location of the content dir define('WP_CONTENT_DIR', dirname(__FILE__).'/../content'); define( 'WP_CONTENT_URL', '/content');
// index.php <?php /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/phpmyadmin RewriteRule ^(.*)$ /wp/$1
{ ... "repositories": [ { "type": "composer", "url" : "https://wpackagist.org" } ], "extra": { ... "installer-paths": { "web/content/plugins/{$name}/": ["type:wordpress-plugin"], "web/content/themes/{$name}/": ["type:wordpress-theme"] } }, "require": { ... "wpackagist-theme/twentynineteen": "*" } }
// wp-config.php define('WP_THEME_DIR', dirname(__FILE__).'/../content/themes' ); define('WP_PLUGIN_DIR', dirname(__FILE__).'/../content/plugins' );
composer update
site/web/wp/ site/web/content/vendor/ site/web/content/themes/* site/web/content/plugins/* .vagrant
/* Theme Name: Luna FL partner theme Description: Twenty Nineteen Child Theme Author: John Doe Author URI: http://example.com Template: twentynineteen Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns Text Domain: twentynineteenchild */
!site/web/content/themes/luna-fl-theme
$ git status new file: .gitignore new file: Vagrantfile new file: site/composer.json new file: site/composer.lock new file: site/web/content/themes/luna-fl-theme/style.css new file: site/web/index.php
curl -LO https://deployer.org/deployer.phar mv deployer.phar /usr/local/bin/dep chmod +x /usr/local/bin/dep
dep init
namespace Deployer; require 'recipe/common.php'; // Project name set('application', 'my_project'); ... // Hosts host('project.com') ->set('deploy_path', '~/{{application}}'); // Tasks ... // [Optional] If deploy fails automatically unlock. after('deploy:failed', 'deploy:unlock');
desc('Deploy your project'); task('deploy', [ 'deploy:info', 'deploy:prepare', 'deploy:lock', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:writable', 'deploy:vendors', 'deploy:clear_paths', 'deploy:symlink', 'deploy:unlock', 'cleanup', 'success' ]);
dep deploy
dep rollback