2023-06-29 14:24:22 +02:00
|
|
|
<div class="divider"></div>
|
2025-03-05 01:58:17 +08:00
|
|
|
<details>
|
|
|
|
|
<summary>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}</summary>
|
|
|
|
|
<div class="tw-mt-2">
|
|
|
|
|
<div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div>
|
|
|
|
|
{{$localBranch := .PullRequest.HeadBranch}}
|
|
|
|
|
{{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
|
|
|
|
|
{{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
|
2022-06-11 16:44:20 +02:00
|
|
|
{{end}}
|
2025-07-15 09:48:14 +02:00
|
|
|
<div class="ui secondary segment tw-font-mono">
|
2025-08-21 20:14:35 +03:00
|
|
|
{{$gitRemoteName := ctx.RootData.SystemConfig.Repository.GitGuideRemoteName.Value ctx}}
|
2025-03-05 01:58:17 +08:00
|
|
|
{{if eq .PullRequest.Flow 0}}
|
2026-04-04 01:56:31 +08:00
|
|
|
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{ctx.AppFullLink .PullRequest.HeadRepo.Link}}{{else}}{{$gitRemoteName}}{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
|
2025-03-05 01:58:17 +08:00
|
|
|
{{else}}
|
2025-08-21 20:14:35 +03:00
|
|
|
<div>git fetch -u {{$gitRemoteName}} {{.PullRequest.GetGitHeadRefName}}:{{$localBranch}}</div>
|
2025-03-05 01:58:17 +08:00
|
|
|
{{end}}
|
2023-10-25 17:01:31 +02:00
|
|
|
<div>git checkout {{$localBranch}}</div>
|
|
|
|
|
</div>
|
2025-03-05 01:58:17 +08:00
|
|
|
{{if .ShowMergeInstructions}}
|
|
|
|
|
<div>
|
|
|
|
|
<h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
|
|
|
|
|
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
|
|
|
|
|
{{if not .AutodetectManualMerge}}
|
|
|
|
|
<div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
|
|
|
|
|
{{end}}
|
2024-02-12 14:37:23 -08:00
|
|
|
</div>
|
2025-07-15 09:48:14 +02:00
|
|
|
<div class="ui secondary segment tw-font-mono">
|
2025-03-05 01:58:17 +08:00
|
|
|
<div data-pull-merge-style="merge">
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge --no-ff {{$localBranch}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tw-hidden" data-pull-merge-style="rebase">
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge --ff-only {{$localBranch}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tw-hidden" data-pull-merge-style="rebase-merge">
|
|
|
|
|
<div>git checkout {{$localBranch}}</div>
|
|
|
|
|
<div>git rebase {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge --no-ff {{$localBranch}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tw-hidden" data-pull-merge-style="squash">
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge --squash {{$localBranch}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tw-hidden" data-pull-merge-style="fast-forward-only">
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge --ff-only {{$localBranch}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tw-hidden" data-pull-merge-style="manually-merged">
|
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
|
<div>git merge {{$localBranch}}</div>
|
|
|
|
|
</div>
|
2025-08-21 20:14:35 +03:00
|
|
|
<div>git push {{$gitRemoteName}} {{.PullRequest.BaseBranch}}</div>
|
2023-10-25 17:01:31 +02:00
|
|
|
</div>
|
2025-03-05 01:58:17 +08:00
|
|
|
{{end}}
|
2022-06-11 16:44:20 +02:00
|
|
|
</div>
|
2025-03-05 01:58:17 +08:00
|
|
|
</details>
|