git - 如何在本地测试来自 GitLab 的 pull 请求?

标签 git github gitlab pull-request

为了审查/测试 GitLab pull 请求,可以使用此命令:

git fetch remote pull/ID/head:branch_to_use_locally

这里,remote 是 GitLab 上的一个项目。 More details in GitLab FAQ .

使用GitLab时对应的命令是什么?

最佳答案

很像。存在细微差别是因为在 GitLab 中使用 merge requests 而不是来自 GitHubpull requests。这包括创建一个远离 master 的分支,稍后再 merge 到其中。

要测试 merge 请求,您需要做的就是获取并 checkout 发送用于 merge 的分支:

git fetch <repo> <branch>
git checkout -b <branch>

每个 merge 请求中还有一个按钮,其中包含在本地检查差异的说明:

enter image description here

关于git - 如何在本地测试来自 GitLab 的 pull 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42646706/

相关文章:

Git:分支上的文件不再需要在分支上

git - 如何编写外部 git diff 来比较添加的行和删除的行(并 stash 匹配项)?

azure - 继续部署无法与 github 私有(private)存储库正常工作

git - 在服务器端复制 git 客户端 Hook

ruby-on-rails - 此版本的 GitLab 依赖于 gitlab-shell 2.6.3,但您运行的是未知。请更新 gitlab-shell

git - .gitattributes中的`* text = auto`和`* text eol = lf`有什么区别?

javascript - 为什么在 Firefox 中不加载图像 anchor 链接?

github - $ git commit --amend 不改变/保存提交信息

Git 提交 bash 脚本

git - 一次提交的多个管道?