Source Control


With the variety of Bronze, Silver and Gold challenges, and the need to keep them separate from the projects under construction through the chapters, I think it is a big missed opportunity not to devote some time in the book on Source Control.

I have been using Source Control to branch off the code to do the challenges, then load the original version to get back to the version without the challenge changes.

A proper tutorial on commit, check out, merging etc would be beneficial. I can’t seem to get check out to work, and I don’t know how to get it working. (User error or not set up correctly.)


Creating chapter-specific branches is exactly what I did as I progressed through the book. Here was my workflow:

When I began work in a new chapter, I’d create a new branch, based on the previous chapter’s branch (when applicable). So, for the Homepwner in chapter nine, I’d make sure I was on chapter eight’s branch, and then create a new branch:

$ git checkout chapter-8 $ git checkout -b chapter-9

So now all my chapter nine-specific work would happen in the ‘chapter-9’ branch.

When I finished a chapter (before the challenges), I’d commit my work, and then create a branch for the challenge. So, for chapter nine, my workflow would look something like this:

$ git add [whatever files I modified in chapter 9] $ git commit -m "completed chapter 9" $ git checkout -b chapter-9-bronze

And then I’d start working on the bronze challenge. To get back to the “main” branch for the chapter before starting the next chapter, I’d just git checkout the chapter branch, and create the new branch for the next chapter

$ git checkout chapter-9 $ git checkout -b chapter-10

I’m hardly a git expert, but this workflow worked pretty well for me, overall.


Thanks. I was using only the GUI interface, but had to use git commands when I forgot to give Homeowner source control. Only through git was I able to add source control after starting a project without it. I suppose I should delve further into the git commands.

I like branching the code instead of copying (as suggested in the book), as it is less clutter than having new directories for the challenges. (And I noticed that some peoples code that the post for regular working through the book has challenge code from earlier chapters. - certainly a bad practice).


As a noob developer I would love some direction with this. Any tutorial / write up? I understand the concept of version control but no real world application.