我正在尝试从本地分支(甚至从本地的主分支/主干)向我的远程仓库提交PR,但无论我做什么都会出现以下错误:
从本地main
尝试:
(master)$ gh pr create --title "Adding readme" --body "Testing pr from cli" --head armsp:feature
Creating pull request for armsp:feature into master in armsp/----
pull request create failed: GraphQL error: Head sha can't be blank, Base sha can't be blank, No commits between master and feature, Head ref must be a branch
从本地特性
分支尝试:
(feature)$ gh pr create --title "Adding readme" --body "Testing pr from cli" --head armsp:feature
Creating pull request for armsp:feature into master in armsp/----
pull request create failed: GraphQL error: Head sha can't be blank, Base sha can't be blank, No commits between master and feature, Head ref must be a branch
整个过程的一般步骤为:
- 从本地主干提交和推送一些文件到远程主干
- 创建新的本地分支
feature
,编辑一些内容,提交更改 - PR
- 使用
--head
参数从本地分支直接向远程发出PR而不创建相同的远程分支 - 从本地主干使用
--head
参数,而不创建远程分支
- 使用
gh
版本:$ gh version
gh version 1.2.1 (2020-11-11)
注意:必须通过终端/cli完全进行PR。