2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2023-10-25 20:31:31 +05:30
|
|
|
<div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint" | Safe}} </div>
|
2023-02-19 09:36:14 +05:30
|
|
|
<div class="instruct-content gt-mt-3 gt-hidden">
|
2023-10-25 20:31:31 +05:30
|
|
|
<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}}
|
|
|
|
{{end}}
|
2022-06-11 20:14:20 +05:30
|
|
|
<div class="ui secondary segment">
|
2023-10-25 20:31:31 +05:30
|
|
|
{{if eq .PullRequest.Flow 0}}
|
|
|
|
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<gitea-origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></gitea-origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
|
|
|
|
<div>git checkout {{$localBranch}}</div>
|
2022-06-11 20:14:20 +05:30
|
|
|
{{else}}
|
2023-10-25 20:31:31 +05:30
|
|
|
<div>git fetch -u origin {{.GetGitRefName}}:{{$localBranch}}</div>
|
2022-06-11 20:14:20 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-10-25 20:31:31 +05:30
|
|
|
{{if .ShowMergeInstructions}}
|
|
|
|
<div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div>
|
2022-06-11 20:14:20 +05:30
|
|
|
<div class="ui secondary segment">
|
2023-10-25 20:31:31 +05:30
|
|
|
<div data-pull-merge-style="merge">
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git merge --no-ff {{$localBranch}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="gt-hidden" data-pull-merge-style="rebase">
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git merge --ff-only {{$localBranch}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="gt-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="gt-hidden" data-pull-merge-style="squash">
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git merge --squash {{$localBranch}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="gt-hidden" data-pull-merge-style="manually-merged">
|
|
|
|
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git merge {{$localBranch}}</div>
|
|
|
|
</div>
|
|
|
|
<div>git push origin {{.PullRequest.BaseBranch}}</div>
|
2022-06-11 20:14:20 +05:30
|
|
|
</div>
|
2023-10-25 20:31:31 +05:30
|
|
|
{{end}}
|
2022-06-11 20:14:20 +05:30
|
|
|
</div>
|