I am trying to figure out how to make a PR to my remote repository from a local branch (or even from local master/main branch). However, no matter what I do I get the following error:
Attempt from local 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
Attempt from the local feature
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
The general steps for the whole situation is -
- Commit and push some files from local main to remote main
- Make a new local branch
feature
, edit something, commit - PR
- Use
--head
arguement ofgh
from local branch to make PR directly to remote without making the same remote branch - Use
--head
arguement ofgh
from the local master without making a remote branch
- Use
I have seen a couple of issues on the github cli repo and they seem to have been fixed in a release, but it unfortunately still doesn't work for me.
- Issue 1: https://github.com/cli/cli/issues/1820
- Issue 2: https://github.com/cli/cli/issues/1709
My gh
version
$ gh version
gh version 1.2.1 (2020-11-11)
NOTE: It is IMPERATIVE that I make the PR completely via terminal/cli.