code.gitea.io/gitea@v1.22.3/templates/repo/issue/view_content/pull_merge_instruction.tmpl (about) 1 <div class="divider"></div> 2 <div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} </div> 3 <div class="instruct-content tw-mt-2 tw-hidden"> 4 <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div> 5 {{$localBranch := .PullRequest.HeadBranch}} 6 {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}} 7 {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}} 8 {{end}} 9 <div class="ui secondary segment"> 10 {{if eq .PullRequest.Flow 0}} 11 <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> 12 {{else}} 13 <div>git fetch -u origin {{.PullRequest.GetGitRefName}}:{{$localBranch}}</div> 14 {{end}} 15 <div>git checkout {{$localBranch}}</div> 16 </div> 17 {{if .ShowMergeInstructions}} 18 <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div> 19 <div class="ui secondary segment"> 20 <div data-pull-merge-style="merge"> 21 <div>git checkout {{.PullRequest.BaseBranch}}</div> 22 <div>git merge --no-ff {{$localBranch}}</div> 23 </div> 24 <div class="tw-hidden" data-pull-merge-style="rebase"> 25 <div>git checkout {{.PullRequest.BaseBranch}}</div> 26 <div>git merge --ff-only {{$localBranch}}</div> 27 </div> 28 <div class="tw-hidden" data-pull-merge-style="rebase-merge"> 29 <div>git checkout {{$localBranch}}</div> 30 <div>git rebase {{.PullRequest.BaseBranch}}</div> 31 <div>git checkout {{.PullRequest.BaseBranch}}</div> 32 <div>git merge --no-ff {{$localBranch}}</div> 33 </div> 34 <div class="tw-hidden" data-pull-merge-style="squash"> 35 <div>git checkout {{.PullRequest.BaseBranch}}</div> 36 <div>git merge --squash {{$localBranch}}</div> 37 </div> 38 <div class="tw-hidden" data-pull-merge-style="fast-forward-only"> 39 <div>git checkout {{.PullRequest.BaseBranch}}</div> 40 <div>git merge --ff-only {{$localBranch}}</div> 41 </div> 42 <div class="tw-hidden" data-pull-merge-style="manually-merged"> 43 <div>git checkout {{.PullRequest.BaseBranch}}</div> 44 <div>git merge {{$localBranch}}</div> 45 </div> 46 <div>git push origin {{.PullRequest.BaseBranch}}</div> 47 </div> 48 {{end}} 49 </div>