Why can't I make a pull request in GitHub mobile?
This blog relies on GitHub to function. My current workflow is to write a blog post in its own git branch. Then I can do one of two things. I can merge the post branch into the main branch and push that directly to GitHub. This bypasses the pull request stage and immediately begins the GitHub action that builds the blog pages. My second option is to push the branch to GitHub, then create a pull request to merge the branch into the main branch. Once the pull request is approved and merged, the build step happens.
While the first option is quicker and less hassle, I prefer the second. Ideally, I want to have a blog post ready to go at least the day before. Sometimes I'll have multiple branches of draft articles in the works at once. I also prefer the pull request route because I can give my code one final look before pushing it live. Generally, with a blog post, there isn't much actual code changing, but sometimes I'll catch a typo or errant change before finalizing the merge.
Last month, when I had a really solid backlog of articles ready to go, I thought it would be neat to open a pull request and kick off the build when I first woke up in the morning. So I opened up GitHub mobile, navigated to my repo, clicked the pull requests button, and...
There's absolutely no way to create a pull request. No button. Changing to the feature branch doesn't help either.
This seems to be an increasingly important feature, judging by GitHub discussions. A question was posed in 2021 about adding the ability to create pull requests on mobile. Initially, there was some discussion with the GitHub team, and the feature was being "tracked by [the] team". Unfortunately, in 2024, the feature still hasn't been implemented.
It has been partially implemented, as explained by a GitHub staff member in 2023:
"While you are browsing code in a repository (public or private), you can open a file and tap on the overflow menu icon where you will see an option to 'Edit File'. Then you will be redirected to a text editor where you can edit the file, and once you are done, you can commit the changes, keep editing more files, or open a pull request.
The functionality to creating files is going to be available pretty soon. And the possibility to create pull requests from existing branches is not planned for now, but we would like to build it at some point."
Unfortunately, this is a less than ideal situation. You can edit an existing file in an existing branch and then create a pull request, but this isn't a workflow that I think most people use. I think it's more likely that people are going to have completed code from another computer that they want to pull request and merge on the go.
This response also gives me other questions. Why can't I create a new branch or new files from the mobile app? Why can't I just work within the GitHub mobile app to whip up a quick code change? If the only device I have is my phone for an emergency fix, I would have to clone the repo in Termux (which I haven't even installed on my Pixel 8, and that's a whole process in itself), create a branch, create the files, then push those to GitHub. Then I could make my edits in GitHub, but then... I can't actually create a pull request to then merge and kick off a build!
Even when I wrote an article about blogging from my phone with Termux I was still using another computer to do the heavy lifting, and created the pull requests with that computer (although this was a pre-GitHub Actions workflow). I even talked about how I could use GitHub as a CMS since I'm deploying with GitHub Actions, but not being able to do so from mobile definitely adds some friction.
At least, if I remember to create the pull request ahead of time from whatever computer I'm using, I can have it ready to merge from mobile at a later date. I did test this ability later, by creating a pull request for one of my posts the night before, then merging the pull request in the morning.
Not being able to create new branches, files, and pull requests from the mobile app keeps the phone from being a viable option for emergency or quick one-off commits. While the idea of editing an existing file and creating a pull request from that might be a workaround, that hacky workflow shouldn't be something that developers must rely on to get by. While GitHub has been adding great features like GitHub Actions and Copilot (saw that Copilot commercial during the Super Bowl yesterday!), I wish they would resolve this pain point. Judging from the ongoing discussion and upvotes, it seems like it would be beneficial for a lot of people.