David - Musings of an SRE

Git pull request for Git

One of the nice features of a forking workflow is that your repository is always clean and you can pick and choose features from other forked developers’ repository to merge with yours.

When we usually think ‘fork’ and ‘git’, I’m sure to most of us, Github’s forking/pulling workflow comes in mind.

But did you know you can actually do a git-pull-request on a non-github repository and also on a centralized feature branch workflow?

How does this work:

  1. Lets say I’m the Developer on this fictional project that tracks Superman’s GPS location in real-time and I’ve created a new remote branch called “fix_supercool_bug”.
  2. I’ve made my commits and pushed it in the remote branch
  3. I want to let the Maintainer know that I’ve fixed a bug and to merge it into the main master branch
  4. Simply, I would just need to type:
/app/tracksuperman/$ $ git request-pull origin/master git://myrepository.git | mailx [email protected] -s “Bug 1234 - Request to pull”

git request-pull on its own generates a templated message body which you could then copy and paste to a mail software of your choice to notify your maintainer. Alternatively, like in the above example, you could pipe it to an external software that sends out an e-mail.

Its clunky, but for a huge project, it would certainly add some additional order. (I’m thinking for the Maintainer!)

Source: Koha-community