Skip to content

Instantly share code, notes, and snippets.

@namanyayg
Last active August 29, 2015 13:57
Show Gist options
  • Save namanyayg/9568205 to your computer and use it in GitHub Desktop.
Save namanyayg/9568205 to your computer and use it in GitHub Desktop.
<?php
$branchname = $_GET['branch'];
if (!$branchname) {
echo "Please enter a branchname, ?branch=<name>";
return false;
}
$command = 'cd <directory> && git checkout ' . $branchname;
$output = shell_exec($command . ' 2>&1');
echo 'Checking out ' . $branchname . '&hellip;<br>';
echo $output . '<br>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment