Version control setup for a tutorial

前端 未结 4 983
南旧
南旧 2021-01-14 03:18

I\'m trying to set up version control for a programming-related tutorial. It\'s proving problematic because there are two different kinds of history:

There\'s the hi

4条回答
  •  一整个雨季
    2021-01-14 03:51

    Rather than rewriting the history of the all project because of a late fix to an early chapter, I would rather isolate each chapter in its own branch, have each HEAD representing the current state for each chapter.
    Assembling the all tutorial is then more a release management issue (deploying your tutorial by extracting the relevant informations from the Git Repo).

    You can then develop your tutorial to achieve something similar to git immersion.

    (Note: If this was more an ebook you were after, then git-scribe would have been a more interesting way to version it.)


    The OP rusky adds in the comments:

    I'm trying to version the sample code for the chapters, where each chapter's code is based on the previous chapter's code

    That means any bugfix you add needs to be reported to the other branches representing the other chapters, in which case see:

    • In Git, how do you apply a commit of bug fix to the other newer branches? (avoiding cherry-picking, which is generally a bad idea)
    • using a topic branch
    • rebase --onto solution

提交回复
热议问题