I’ve made multiple changes to two files in a Git repository (specifically, added two formulae to brew).
I committed the changes individually:
git commit file1
git commit file2
I then did one push to GitHub:
git push git@github.com:myname/homebrew.git
I’d now like to send two pull requests to the upstream repository, one for file1, one for file2. Is this possible?
If you changed both files in the same commit, then no, this isn’t possible. Pushes and pulls operate at a commit level; they won’t split them apart.
If you haven’t shared the changes yet, you could split the commit into two, making a branch for each, and then initiate pull requests for those.
This is one of those things there are many ways to do, but for example, you could do something like this:
This would leave you with history like this:
where commit A modified file1, and commit B modified file2.
Once the history looks the way you like it, you can push the two branches separately and do what you need to do with them: