{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}
{{$localBranch := .PullRequest.HeadBranch}}
{{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
{{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
{{end}}
{{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 {{.PullRequest.GetGitRefName}}:{{$localBranch}}
{{end}}
git checkout {{$localBranch}}
{{if .ShowMergeInstructions}}
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
{{if not .AutodetectManualMerge}}
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}
{{end}}
git checkout {{.PullRequest.BaseBranch}}
git merge --no-ff {{$localBranch}}
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}}