From 533183591be5e24c0ae6e6f26f3ec455a8acd7a3 Mon Sep 17 00:00:00 2001 From: wushuiyong Date: Tue, 17 Nov 2015 21:53:32 +0800 Subject: [PATCH] reset && checkout => reset --hard --- components/Git.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/Git.php b/components/Git.php index 6ce3e89a..102757b2 100644 --- a/components/Git.php +++ b/components/Git.php @@ -47,8 +47,7 @@ public function updateToVersion($task) { $destination = Project::getDeployWorkspace($task->link_id); $this->updateRepo($task->branch, $destination); $cmd[] = sprintf('cd %s ', $destination); - $cmd[] = sprintf('/usr/bin/env git reset -q %s', $task->commit_id); - $cmd[] = '/usr/bin/env git checkout -q .'; + $cmd[] = sprintf('/usr/bin/env git reset -q --hard %s', $task->commit_id); $command = join(' && ', $cmd); return $this->runLocalCommand($command);