diff options
author | Rob Loach <robloach@gmail.com> | 2013-12-25 07:47:58 -0500 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2013-12-25 07:47:58 -0500 |
commit | 7ac95ae857f496dc6092d978fdd1b12d0dc13b83 (patch) | |
tree | 080826fe0ac1b1ec2197e4e36e5639823742d775 /src | |
parent | 00830e04b65b2ae71200ec48d6598960c13f1c90 (diff) | |
download | git-deploy-7ac95ae857f496dc6092d978fdd1b12d0dc13b83.zip git-deploy-7ac95ae857f496dc6092d978fdd1b12d0dc13b83.tar.gz git-deploy-7ac95ae857f496dc6092d978fdd1b12d0dc13b83.tar.bz2 |
Clean the repository0.0.2
Diffstat (limited to 'src')
-rw-r--r-- | src/GitHubPagesDeploy/GitHubPagesDeploy.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/GitHubPagesDeploy/GitHubPagesDeploy.php b/src/GitHubPagesDeploy/GitHubPagesDeploy.php index 34c31d4..bcf2fde 100644 --- a/src/GitHubPagesDeploy/GitHubPagesDeploy.php +++ b/src/GitHubPagesDeploy/GitHubPagesDeploy.php @@ -33,6 +33,7 @@ class GitHubPagesDeploy $wrapper->streamOutput(); foreach ($this->repositories as $dir => $repo) { + // Build our git interface. $git = null; if (!is_dir($dir)) { $git = $wrapper->cloneRepository($repo, $dir); @@ -41,17 +42,20 @@ class GitHubPagesDeploy $git = new GitWorkingCopy($wrapper, $dir); } + // Fetch all the latest. + $git->fetch('--all'); + // Remove any local changes. $git->reset(array('hard' => true)); + // Clean up the repository. + $git->run(array('clean', array('d' => TRUE, 'f' => TRUE))); + // Ensure we are on the correct branch. - $git->checkout('gh-pages'); + $git->checkout('gh-pages', array('force' => TRUE)); - // Pull in any changes. + // Finally, pull in the changes. $git->pull(); - - // Ensure there aren't any local changes. - $git->reset(array('hard' => true)); } } |