# Branching or duplication in source control?

I'm writing a thesis, using latex, and git. I'm using \include for chapters. I also want to turn it into a journal article. I also have to give 2 or 3 presentations, which are for slightly different audiences, and may need slightly different content.

Does it make more sense to create branches in git, and merge/rebase/cherry-pick changes that apply to multiple documents, or is it more sensible to just duplicate the text, and keep them in the same branch? Or is there a better way that I haven't thought of?

-

Well, this is a very good and tricky question ...

First of all, I don't think there can be a definitive answer to such a question. It's not only a matter of personnal preference, but also very depends on what kind of things you apply it to.

Then, my opinion on this.

To me, a thesis, an article and a presentation on the same subject will have very different content even though they might share the same results and some figures. They will not only be very different in the size of the documents, but also in the aim you ar writing for and the style you should use.

Therefore, I think it might be advised to just "duplicate" the text, although you will soon find out that you do not duplicate anything but more kind of rewright the things in a different way as you aim for different things and understand better the topic.

What I would however share would be the figures, graphs, tables and bibliographic databases which can be useful in several documents and have no real reason of changing that much.

I also would advise you to be cautious in that matter with reviewed material. Indeed, once validated, you theoretically cannot change the content of what was validated (even if you cas keep up to date a copy of the material for yourself).

To takkle this issue, maybe I would use a sub-repository for every document "project" and another one for the ressources and then use tags on the reviewed material to be sure not to lose the trace of what exactly was published.

Another way of doing it would be to keep somewhere a copy of the document tat you do not touch anymore once validated.

So in the end my very personnal answer to this would be : do not be affraid to duplicate text as long as it's not exact duplicate, which is very unlikely to happen unless it is a ressource for your projects and then should be put in common.

-
The point about not changing reviewed material is good, although one would assume you'd HAVE to change it after you get the reviews back, if you want it published. The beauty of a VCS is that you can just tag which ever version you submit, and then keep working. If you need it back, just check it out again :) –  naught101 Oct 17 '12 at 5:53
Yeahr, of course, when I say reviewed material, it's not just what was sent to the reviewer, but more the final version that has been accepted. –  Samuel Albert Oct 18 '12 at 12:41
sure, but the same thing applies - just tag that version :) –  naught101 Oct 18 '12 at 23:46