Will Vousden
Will Vousden

Reputation: 33358

How should I structure these projects in Git?

I have a template written in TeX from which I start most of the documents I write, consisting of a few .tex files and some other auxiliary files too.

I'd like this template and any downstream documents each to have their own (bare) repositories kept on a server, but changes will have to be merged to and from the template repository from the downstream ones. For example, I might want to modify the template and merge those changes into all of the documents I've created.

What's the best way to implement this kind of repository structure?

Upvotes: 0

Views: 100

Answers (1)

Paul
Paul

Reputation: 21975

Maybe create a branch template where you could keep your template and then create other branches from it like doc1, doc2, then on any modification to the template you could easily merge it on doc1 and doc2 for example.

So here is the 'algorithm':

git checkout template

Hack the template...

git checkout -b doc1 - create a doc starting off of template

Hack the doc...Oops, you discover something is wrong with the template

git checkout template

Fix it...

git checkout doc1 && git merge template - so you changed the template in doc1 and you can continue working at this document

Upvotes: 1

Related Questions