The critical difference is that Apache Tika Git is generated from SVN, and has a 'trunk' branch instead of a 'master'.
- We had already forked the project on GitHub (clicked the Fork button)
- Cloned the fork locally ($ git clone --recursive https://github.com/openplanets/tika)
- cd into your local repository ($ cd tika)
- Link with the upstream repository ($ git remote add upstream git://github.com/apache/tika.git) Note that git://git.apache.org/tika.git might be a better bet as the GitHub one is only synchronised daily.
- Create a branch for your work ($ git checkout -b my-work). Choose a name more appropriate to the work you’re doing than “my-work”. (I chose 'ibooks-support')
- Develop on your branch (not on trunk!)
- Commit changes to the branch ($ git add . ; git commit -m 'commit message')
- Sync up with upstream to keep your working copy’s master branch and issue branch up to date: ($ git fetch upstream; git checkout trunk; git rebase upstream/trunk; git checkout my-work; git rebase trunk)
- Repeat steps 6-8 until your work is complete
- Push your changes to GitHub ($ git push origin my-work)
Avoid using git pull without due care, or you'll pull changes from the wrong branch into your current branch.
Apache Tika doesn't accept pull requests, but rather accepts patches via JIRA. I therefore made a patch and submitted it.
The changes were accepted with minor modifications. This meant that re-syncing with trunk didn't really work due to conflicts. i.e.
all failed and I ended up rather clumsily discarding my own changes and overwriting with the versions from HEAD on trunk.
There may be better ways to deal with this case - any suggestions?