问题
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