{{if eq .PullRequest.Flow 0}}
git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
{{else}}
git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}
{{end}}
git checkout {{$localBranch}}
{{if .ShowMergeInstructions}}
git checkout {{.PullRequest.BaseBranch}}
git merge --no-ff {{$localBranch}}
git checkout {{$localBranch}}
git rebase {{.PullRequest.BaseBranch}}
git checkout {{.PullRequest.BaseBranch}}
git merge --ff-only {{$localBranch}}
git checkout {{$localBranch}}
git rebase {{.PullRequest.BaseBranch}}
git checkout {{.PullRequest.BaseBranch}}
git merge --no-ff {{$localBranch}}
git checkout {{.PullRequest.BaseBranch}}
git merge --squash {{$localBranch}}
git checkout {{.PullRequest.BaseBranch}}
git merge --ff-only {{$localBranch}}
git checkout {{.PullRequest.BaseBranch}}
git merge {{$localBranch}}
git push origin {{.PullRequest.BaseBranch}}
{{end}}