Skip to content

Commit

Permalink
IGit, GitRepository: add missing push() (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
gerryd authored and janpecha committed Apr 20, 2016
1 parent a646863 commit 22e1786
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,26 @@ public function pull($remote = NULL, array $params = NULL)
}


/**
* Push changes to a remote
* @param string|NULL
* @param array|NULL
* @return self
* @throws GitException
*/
public function push($remote = NULL, array $params = NULL)
{
if(!is_array($params))
{
$params = array();
}

return $this->begin()
->run("git push $remote", $params)
->end();
}


/**
* @param string
* @param callback|NULL
Expand Down
10 changes: 10 additions & 0 deletions src/IGit.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ function hasChanges();
function pull($remote = NULL, array $params = NULL);


/**
* Push changes to a remote
* @param string|NULL
* @param array|NULL
* @return self
* @throws GitException
*/
function push($remote = NULL, array $params = NULL);


/**
* Init repo in directory
* @param string
Expand Down

0 comments on commit 22e1786

Please sign in to comment.