Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`hub` pull-request for organization repository

Tags:

git

github

I want to create a pull request for git from the command line using hub. I have a clone of a repository belonging to an organization. The repository is using git flow, so I want to create a pull request for the develop branch. I have already pushed my feature branch to the organization's repository.

All of the following give me:

Error creating pull request: Unprocessable Entity (HTTP 422)
Missing field: "head_sha"
Missing field: "base_sha"
No commits between Organization:branch and user:feature-branch

git pull-request
git pull-request -b develop
git pull-request -b Organization/Repo/develop
git pull-request -b Repo/develop
git pull-request -b origin/develop

I also tried using -b Organization:Repo:develop, but that returns a 500 error. -b Repo:develop returns a 404.

How can I create a pull request via hub?

like image 739
Explosion Pills Avatar asked Oct 31 '13 13:10

Explosion Pills


People also ask

How do I create a pull request for a repo?

Once you've committed changes to your local copy of the repository, click the Create Pull Request icon. Check that the local branch and repository you're merging from, and the remote branch and repository you're merging into, are correct. Then give the pull request a title and a description. Click Create.

How do I pull a shared repository from GitHub?

Go to your version of the repository on github. Click the “Pull Request” button at the top. Note that your friend's repository will be on the left and your repository will be on the right. Click the green button “Create pull request”.


1 Answers

Try this:

git pull-request -b org:master -h org:feature

Gift wrapped for .bashrc

function pull_request() {
  BASE="${1:-master}"
  HEAD=`git rev-parse --abbrev-ref HEAD`
  ORG=org
  hub pull-request -b ${ORG}:${BASE} -h ${ORG}:${HEAD}
}
like image 143
Manav Avatar answered Oct 29 '22 16:10

Manav