从命令行git pull审查git请求代码 [英] git request code review from command line git pull

查看:164
本文介绍了从命令行git pull审查git请求代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用我们的共享存储库,当我需要合并更改时,我必须从github页面请求合并请求,在将其推送之前将对其进行检查.

I am using our shared repository, when i need to merge my changes in, I have to request a merge pull request from github page,which will be checked be a reviwer before it can be pushed up.

从命令行进行简单的git pull会导致:

A simple git pull from the command line results in :

remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: At least one approved review is required by reviewers with write access.

示例:

我有一个本地主机和一个本地功能分支

I have a local master, and a local feature branch

我结账的主人,我从功能分支引入更改

I checkeout master, I pull in changes from feature branch

现在,本地主机通过一次提交就落后于原始主机

Now local master is behind the origin master by 1 commit

我想推送掌握,我使用git push

I want to push to master, i use git push

我在下面收到错误消息,这是因为我们对存储库有一个审查政策.

I receive the error below, this is because we a have review policy on the repository.

我可以通过命令行请求拉取请求吗?

Can I request a pull request via command line?

推荐答案

使用最新的 cli/cli (GitHub命令行),您可以:

With the recent cli/cli (GitHub command line), you can:

通过命令查看,批准和合并PR,全部-行

review, approve and merge a PR, all from the command-line!

例如:

$ gh pr checkout 123
$ gh pr diff
$ gh pr review --approve -b "lgtm"
$ gh pr merge

这篇关于从命令行git pull审查git请求代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆