-
Notifications
You must be signed in to change notification settings - Fork 0
Posting Chapter Exercise Solutions
Study group members should aim to post exercise solutions by Saturday of each week.
Exercise solutions can be posted in two ways:
-
Adding files to individual feature branches for each chapter (recommended):
-
For each chapter, create a new feature branch off of
master
- ideally with your name - example:jjhampton/chapter2-exercises
. Also include your name in each file name, so other study group members don't accidentally overwrite your work - example:jjhampton-ch2-ex1-triangle.js
. Each chapter already has a directory in the repo where the exercise solutions should be saved in - example "Chapter-2-Exercises". -
When your chapter-branch has been created on GitHub and all of your exercise solutions for the chapter have been committed/pushed, open a Pull Request (PR) from your chapter-branch into the
master
branch. While your PR is open, others can also post feedback on your code as PR comments. After your PR is reviewed, it can be merged in / closed. When a PR is opened / closed, an automated Slack message will be posted to the Slack channel. -
This is the recommended workflow, as it most closely resembles a commonly-used Git workflow on a collaborative web project. Users not experienced in using Git may learn a bit more about using Git if they follow this approach.
-
-
Adding files directly to the master branch:
-
You may commit/push up your individual exercise files directly to the
master
branch. Committing directly tomaster
is generally not a best practice on a real project. In our case, there's really no harm done, since we're just adding separate files which don't affect any other files. Anyone should be safe committing directly tomaster
as long as they only add/edit their own files and don't modify anyone else's. -
One issue w/ committing directly to
master
is that if multiple people are doing that around the same time, your local version ofmaster
may get behind the remotemaster
, and when you try to push up a change to GitHub, Git will tell you:Updates were rejected because the tip of your current branch is behind its remote counterpart
. This is because there are newer commits on the remote (GitHub) than you have on your local machine, most likely from commits tomaster
that others have made since you last did agit pull
orgit fetch
. If you see that, you'll have togit pull
orgit pull --rebase
so your localmaster
is up-to-date with the remote changes on GitHub, and then you can try togit push
again.
-
-
Links to external code snippets:
-
Publish your code with any code-snippet sharing service - popular ones are Gist, CodePen, JSBin, or Plunker
-
Post your code snippet link in GitHub Issues or the Slack channel so others can review your work.
-
If you're not experienced with Git/GitHub or simply don't want to create new branches/PRs, this option may be easier.
-