miguelgrinberg / flasky

Companion code to my O'Reilly book "Flask Web Development", second edition.
MIT License
8.54k stars 4.21k forks source link

My Changes #531

Closed mathstrains21 closed 2 years ago

mathstrains21 commented 2 years ago

Hi, I am working along in the book, and have made a change myself in the source code. I have just finished chapter 7. I made a new branch with git switch -c my_changes, and then committed my changes, but am now not sure how to move onto 8a, while keeping my change. Could you enlighten me on how to do this please?

miguelgrinberg commented 2 years ago

Unfortunately there is no automatic way to keep your changes, as you move through the tags in this repository. You basically have two options:

  1. Instead of following the book in doing git checkout [TAG], you can stay in this new branch that you created, and merge each of the tags into it with git merge [TAG]. This will be incrementally adding the changes from the book to the branch that you created. Each time you run the git merge command a new commit will be added to your branch.
  2. Continue using the tags from my repository, and after you do every git checkout [TAG] you reapply your changes on top, for example with git cherry-pick [SHA], where [SHA] is the commit SHA that has your changes.
mathstrains21 commented 2 years ago

Thanks for the very quick response!

Will follow the merge instead of checkout route, and I guess I may have to resolve conflicts occasionally if the code I've added is in the same place as some code you add in later in the book!

Thank you for the help!