Can we create a pull request using command-line tooling? - github

As my browser was crashing I was not able to create a pull request from GitHub UI, I was trying to create a pull request from git console but didn't found any way to create a pull request.
I have also searched for the same over the net but most of the tutorials suggested to create a pull request from UIs only. I just want to be able to handle the pull request like creation, rejection, approved and merging without the browser. Please suggest.

git and github are separate products. github is a service that happens to use git, but it is not part of git, its UI is not a git interface, and git does not have any special support for github functionality.
There is a little potential confusion here, because there are "pull requests" - an integrated feature of github having to do with branch workflow - and there is git request-pull, a seemingly lesser-known feature of git which creates a text message you could send to another repository maintainer to request that they pull changes from your repository.
Naming confusion aside, the "pull request" you want is a feature of github, not git; and so git itself (including git console and any git UI tool) have no command for this. You have to use a github-supplied interface, and AFAIK that means the web UI.

To open a pull request from the command line, you can install the hub set of command-line tools that GitHub supports. This will allow you to create a pull request from a repository with:
hub pull-request
I'm not aware of any similar tools for managing pull requests, though.

git add -p
then
git commit -m "message"
then
git push origin "your_branch"
the pull request will be created in github

Related

Creating pull requests automatically using jgit

I want to build an automation to create many pull requests on GIT by just click of a button. Input for the API would be source and destination branch. I have come across ways to checkout repository using jgit but did not get anything to create pull request automatically. Please assist.

Can I use pull request on Bonobo Git Server

Particularly, my team have a Bonobo git and we must use pull request as a important part of workflow but I can't pull request in Bonobo git even by command, what should I do now? Thanks!
"Pull requests" are not a feature of Git, they're a feature of sites like Github, and Bonobo doesn't have that sort of thing.
Commands like git pull work fine with Bonobo, but that's not a "pull request".

Github for Windows Pull Request for remote Bitbucket Repo

Based on this tutorial I was able to successfully connect Github for Desktop with my remote Bitbucket repo.
Looking at the example tutorial repo I see there is an Pull Request option built in the application - great:
However the option is missing when I chose my remote Bitbucket repo:
I couldn't find any option that is reponsible for this.
Anyone knows what affects this behavior?
"Pull Request" is very much a GitHub feature, associated to GitHub repos.
So For BitBucket, the simplest approach is to push your feature branch to the remote repo (which is a BitBucket one, not a GitHub one), and make your PR from there (from the remote BitBucket web GUI, even within the same repo)
Once the PR is initiated, each push done from the GitHub Desktop will complete said PR.
In Bitbucket go to Settings -> Branch Permissions, and add a new branch permission with your name.
EDIT
https://stackoverflow.com/a/37343356/1544886

Github / EGit pull request workflow

Say I have a repo and someone forks it. Then they do work and submit a pull request. But the code contains a large number of lines and/or it creates a GUI. I'd like to fetch it so I can actually see it run from Eclipse before merging it into my master. The options I've come up with are:
Create a second repo in EGit and clone directly from their fork.
Create a new branch just for them. Then leave a comment for the request asking them to re-submit the pull request using the new branch and that I'll be closing the current request (without merging)
Always keep around a branch for them to use in their pull requests.
Besides setting up an organization on Github what else could I do?
Then leave a comment for the request asking them to re-submit the pull request using the new branch and that I'll be closing the current request
They don't have to re-submit, it you test and merge first locally, as described in the "Merging a pull request" GitHub page.
git checkout master
git pull https://github.com/otheruser/repo.git branchname
If the local merge works, then you can go ahead and merge the pull request through the GitHub web interface.
GitHub has documented how to checkout a pull request.
As I have illustrated before in "What support for git namespaces exists in git hosting services", you can use refs/pull/<PRNumber>/head as remote pull reference, in command line or in Egit when, for instance, creating a new branch.
If the PR number is 123, you can simply use the EGit Pull action, and use pulls/123/head as reference.

GitHub issues as separate repo?

There's already an API for GitHub issues, but has anyone succeeded in making it two-way? That is:
git clone git#github.com:user/repo.issues.git # Like for wiki
editor repo.issues/1.json
git push -u origin master
And voilĂ , a new/updated issue #1!
It could use a pre-receive hook to validate before accepting any pushes, so invalid formatting shouldn't be a problem.
In other words, is there some way to handle the issues of a GitHub project as another GitHub repo?
Aside from using the API, I don't see how this can be done cleanly.
You could put together a (custom) monstrosity that updates a separate GitHub repo with all the issues in said repo at a predefined interval (using the API), but given the effort involved, this better be worth it to you :)