forked from zacharydanger/git-phing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitPushTask.php
More file actions
37 lines (33 loc) · 737 Bytes
/
GitPushTask.php
File metadata and controls
37 lines (33 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once 'GitTask.php';
/**
* Pushes a git repo to some remote repo.
*
* @author Zach Campbell <[email protected]>
*/
class GitPushTask extends GitTask {
private $_remote;
private $_branch;
/**
* Main entry point.
*/
public function main() {
$command = $this->git_path . " push " . $this->_remote . " " . $this->_branch;
$this->log("Pushing: " . $command);
passthru($command, $return);
$this->log("Push Return: " . $return);
}
/**
* Sets the remote repository to push to.
*/
public function setRemote($remote) {
$this->_remote = $remote;
}
/**
* OPTIONAL: Set the branch for the git push command.
*/
public function setBranch($branch) {
$this->_branch = $branch;
}
}
?>