如何在本地签出合并请求,并创建新的本地分支? [英] How to checkout merge request locally, and create new local branch?
本文介绍了如何在本地签出合并请求,并创建新的本地分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在那里有 GitLab 存储库,我需要在本地测试每个合并请求,然后再合并到目标分支.
I have GitLab repository there and I need to test every merge request locally, before merging to the target branch.
如何将合并请求作为新分支提取/获取?
How can I pull/fetch merge request as a new branch?
推荐答案
拉取合并请求到新分支
Pull merge request to new branch
git fetch origin merge-requests/REQUESTID/head:BRANCHNAME
即git fetch origin merge-requests/10/head:file_upload
结帐到新创建的分支
git checkout BRANCHNAME
即(git checkout file_upload
)
OR 与单个命令
git fetch origin merge-requests/REQUESTID/head:BRANCHNAME &&git checkout BRANCHNAME
即git fetch origin merge-requests/18/head:file_upload &&git checkout file_upload
这篇关于如何在本地签出合并请求,并创建新的本地分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文