Skip to content

Commit

Permalink
git fetch 时增加 --prune 参数,远程分支本删除,本地也不再保留
Browse files Browse the repository at this point in the history
  • Loading branch information
littlehz committed Sep 10, 2016
1 parent 4d6d8e7 commit 3ebc6e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function updateRepo($branch = 'master', $gitDir = null) {
if (file_exists($dotGit)) {
$cmd[] = sprintf('cd %s ', $gitDir);
$cmd[] = sprintf('/usr/bin/env git checkout -q %s', $branch);
$cmd[] = sprintf('/usr/bin/env git fetch -q --all');
$cmd[] = sprintf('/usr/bin/env git fetch -p -q --all');
$cmd[] = sprintf('/usr/bin/env git reset -q --hard origin/%s', $branch);
$command = join(' && ', $cmd);
return $this->runLocalCommand($command);
Expand Down Expand Up @@ -161,5 +161,5 @@ public function getTagList($count = 20) {
}
return $history;
}

}

0 comments on commit 3ebc6e5

Please sign in to comment.