git request code review from command line git pull

坚强是说给别人听的谎言 提交于 2020-12-30 02:15:46

问题


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.

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.

Example:

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

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?


回答1:


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

  • mark a PR ready for review

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

For instance:

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


来源:https://stackoverflow.com/questions/50291752/git-request-code-review-from-command-line-git-pull

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!