Jan
Jan

Reputation: 1

Long term branch alternative with git?

I am writing my thesis in mathematics and am about to publish my first paper. So far, I have used git for version control. At this point in time, the text for the paper and the thesis will have to diverge: the thesis will be a lot more detailed than the paper, which will have to be rather concise.

How do I manage this situation with git? I am not quite sure which git option is the best for me. I thought about creating a separate branch for the paper and then cherry-picking commits, but apparently branches are not supposed to be permanent (is that true?). Ideally, I would like a solution where I have to manually duplicate as little as possible as I go about writing both projects simultaneously.

Upvotes: 0

Views: 102

Answers (1)

Gregg
Gregg

Reputation: 2594

Branches can be as permanent as you want them to be. You can create and destroy them just like files.

If your branches (or more specifically the files containing the patches in a cherry pick) diverge too much, cherry pick will not be able to find the patches to make the changes.

If one project is a superset of the other one, you can use 'subtree' (see 'git help subtree'). Which makes changes in the subproject trivially easy to include in the super project. (see also the older command 'submodule')

Upvotes: 2

Related Questions