mirror of
https://github.com/go-gitea/gitea
synced 2024-11-20 09:04:24 +00:00
33fa93a952
Backport #31219 by @lunny Fix #31135 Before <img width="527" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/60c07b55-3db2-4a9a-98f1-0eb72d149df2"> After <img width="664" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/0670ff5d-9e0b-47ac-aba4-9db9131de3b3"> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
50 lines
2.3 KiB
Handlebars
50 lines
2.3 KiB
Handlebars
<div class="divider"></div>
|
|
<div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} </div>
|
|
<div class="instruct-content tw-mt-2 tw-hidden">
|
|
<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}}
|
|
<div class="ui secondary segment">
|
|
{{if eq .PullRequest.Flow 0}}
|
|
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
|
|
{{else}}
|
|
<div>git fetch -u origin {{.PullRequest.GetGitRefName}}:{{$localBranch}}</div>
|
|
{{end}}
|
|
<div>git checkout {{$localBranch}}</div>
|
|
</div>
|
|
{{if .ShowMergeInstructions}}
|
|
<div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div>
|
|
<div class="ui secondary segment">
|
|
<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>
|
|
<div>git push origin {{.PullRequest.BaseBranch}}</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|