Take the 2-minute tour ×

I'm currently working on a project with a few people and I was wondering what could be the best way to share the documentation of our project. I was thinking about adding the doc in some folders and adding it in git but I don't really know how to do this the proper way...

We try to follow this how-to for our git repo : http://nvie.com/posts/a-successful-git-branching-model/

I think it's a pretty common way to manage a git repo : master for the releases, develop for the coming features, one branch per feature... but I don't see any way to include and work on the doc with this model. Should I create a specific branch for the doc ? Should I push it in develop then merge it back every time in the feature branches ? I'm a bit lost...

Thanks for your help :-)

share|improve this question
add comment

1 Answer

You probably want the documentation for a feature to be merged at the same time as the feature itself. To me, that suggests that you should work on the documentation in whatever branch you're editing the code.

Therefore, I'd suggest have a docs directory (as you described in your question), and updating it in your feature branch. That way, if you decide not to merge the feature, then you don't accidentally merge the documentation that accompanied it.

It doesn't make a lot of sense to do it in the develop branch because it's an integration branch. So you'd expect to merge things there, but not do actual development (including writing documentation) there.

Should I create a specific branch for the doc?

If you mean create a branch that only contains documentation, then no, I think that's a bad idea. It's useful to be able to have the code and documentation checked out at the same time, and that's harder if you need to check out two branches.

If you mean create a specific branch for working on documentation, then yes, probably. If you call documentation a feature, then it might make sense to use a feature branch (or something similar of a different name).

share|improve this answer
Thanks for your reply :-) I get it and I think it's a good way if your doc is finished when you merge your feature in develop. But what if you want to update your doc about a specific feature that has been merged a long time ago ? Or even the README at the root of your project ? Do you create a new branch to update the doc and then merge it in develop ? Can an update be considered as a 'feature' ? –  polhomarkho Nov 15 '12 at 17:48
add comment

Your Answer


