{{$data := $.MergeBoxData}} {{$pull := $.PullRequest}}
{{/* align with other item icon & text */}} {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}
{{$args := $pull.GetInstructionsCliArgs}}
{{$gitRemoteName := ctx.RootData.SystemConfig.Repository.GitGuideRemoteName.Value ctx}} {{if eq $pull.Flow 0}}
git fetch -u {{if ne $pull.HeadRepo.ID $pull.BaseRepo.ID}}{{$pull.HeadRepo.HTMLURL ctx}}{{else}}{{$gitRemoteName}}{{end}} {{$args.HeadBranchArg}}:{{$args.LocalBranchArg}}
{{else}}
git fetch -u {{$gitRemoteName}} {{$pull.GetGitHeadRefName}}:{{$args.LocalBranchArg}}
{{end}}
git checkout {{$args.LocalBranchArg}}
{{if $data.ShowMergeInstructions}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}} {{if not $data.AutodetectManualMerge}}
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}
{{end}}
git checkout {{$args.BaseBranchArg}}
git merge --no-ff {{$args.LocalBranchArg}}
git checkout {{$args.BaseBranchArg}}
git merge --ff-only {{$args.LocalBranchArg}}
git checkout {{$args.LocalBranchArg}}
git rebase {{$args.BaseBranchArg}}
git checkout {{$args.BaseBranchArg}}
git merge --no-ff {{$args.LocalBranchArg}}
git checkout {{$args.BaseBranchArg}}
git merge --squash {{$args.LocalBranchArg}}
git checkout {{$args.BaseBranchArg}}
git merge --ff-only {{$args.LocalBranchArg}}
git checkout {{$args.BaseBranchArg}}
git merge {{$args.LocalBranchArg}}
git push {{$gitRemoteName}} {{$args.BaseBranchArg}}
{{end}}