for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CleaniqueCoders\Console\Traits;
trait GitTrait
{
/**
* Initiliase git repository.
*
* @return void
*/
public function gitInit()
if ($this->gitInstalled()) {
exec('git init && git add . && git commit -m "Initial Commits"');
}
* Commit composer.lock on update dependencies.
public function gitCommitUpdateDependecies()
exec('git add composer.lock && git commit -m "Upadate dependencies"');
* Check if git is installed.
public function gitInstalled(): bool
return ! empty(exec('which git'));