Tuesday, October 13, 2009

What to do with a Github pull request

So, I've got a pull request for the supybot-mantis plugin I'm hosting at github.com; how do I move the commits from the fork back into the master repo?

Searching the net does not give many results, but from some of them I've got the general idea: I just need to add a new remote to track changes in the fork, then merge in the changes so the whole thing was just few commands away :)

Initial situation
git branch -a
* master
origin/HEAD
origin/master


Add new remote and fetch data
git remote add -f hugues git://github.com/hugues/

New situation
git branch -a
* master
hugues/master
origin/HEAD
origin/master


(Optionally) review commits in the new remote with:
[giallu@bingo supybot-mantis]$ git log -p ..hugues/master

Everything ok, merge from the forked repo
git merge hugues/master

Finally push to github
git push