diff options
author | Rob Loach <robloach@gmail.com> | 2013-12-15 05:51:03 -0500 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2013-12-15 05:51:03 -0500 |
commit | 00830e04b65b2ae71200ec48d6598960c13f1c90 (patch) | |
tree | 28b48b84b71fa48c4a35329c0d6b87a0b5da10e1 /src | |
parent | edbd1d58002ca61f7c1e24acb4341f7fa03ebe42 (diff) | |
download | git-deploy-00830e04b65b2ae71200ec48d6598960c13f1c90.zip git-deploy-00830e04b65b2ae71200ec48d6598960c13f1c90.tar.gz git-deploy-00830e04b65b2ae71200ec48d6598960c13f1c90.tar.bz2 |
Reset before pulling
Diffstat (limited to 'src')
-rw-r--r-- | src/GitHubPagesDeploy/GitHubPagesDeploy.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/GitHubPagesDeploy/GitHubPagesDeploy.php b/src/GitHubPagesDeploy/GitHubPagesDeploy.php index c7f1a17..34c31d4 100644 --- a/src/GitHubPagesDeploy/GitHubPagesDeploy.php +++ b/src/GitHubPagesDeploy/GitHubPagesDeploy.php @@ -41,8 +41,17 @@ class GitHubPagesDeploy $git = new GitWorkingCopy($wrapper, $dir); } + // Remove any local changes. + $git->reset(array('hard' => true)); + + // Ensure we are on the correct branch. $git->checkout('gh-pages'); + + // Pull in any changes. $git->pull(); + + // Ensure there aren't any local changes. + $git->reset(array('hard' => true)); } } |