reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Weimer <mar...@weimo.de>
Subject Re: A git question
Date Thu, 14 Apr 2016 20:58:19 GMT
On 4/14/2016 11:54 AM, Dhruv Mahajan wrote:
> No :( ... The remote branches have all been deleted...whats remaining is a
> pull request.

Oh wow. You also nuked your remote? That is a thorough clean :)

You can checkout an individual pull request via

```
$> git fetch https://github.com/apache/reef pull/$PR/head:$branch
```

replace $PR with the numerical ID of the pull request and $branch with 
the name of the branch you want to create locally. Alternatively, you 
can add the following code to your PowerShell profile:

```
function REEF-Checkout-PullRequest{
     param
     (
         [Parameter(Position=0, Mandatory=$true, HelpMessage='The pull 
request numer')]
         [int]$PR,
         [Parameter(Mandatory=$false, HelpMessage='The branch to check 
the PR out into')]
         [string]$B
     )

     $branch = if([string]::IsNullOrEmpty($B)) {"PR-$PR"} else {$B}
     Invoke-Expression "git fetch https://github.com/apache/reef 
pull/$PR/head:$branch"
     Invoke-Expression "git checkout $branch"
}
```

Markus

Mime
View raw message