This is a repository that will be used to hold submissions for exercises completed as part of the N4 Developer Training. These exercises are not mandatory, and submission is not mandatory even if you do the exercise.
These steps only need to be completed once to get the repo onto your machine.
If you know that you won't be interested in submitting any of your work for code reviews and you want to use git and GitHub as little as possible, you can download this repository as a zipfile.
- Login to GitHub and navigate to this repo.
- Click the Code button.
- In the resulting pop-up menu, click Download ZIP.
- Extract the zipfile.
- Edit the
gradle.properties
file as necessary for your machine. Theniagara_home
andniagara_user_home
variables should have the same values for these exercises as they do for the labs in class. Also make sure thatnodeHome
is set to the location of your installation of Node.
If you might be interested in submitting your work for code review or if you want to try a more real-world git workflow, you can fork and clone this repository.
- Login to GitHub and navigate to this repo.
- Click Fork in the top right corner to create a fork of this repository in your own GitHub account.
- Create a clone of your forked repository on your machine. One way to do this is to click the Code button in your forked repository, copy the shown URL, and run the command
git clone <forked_repo_url>
on your machine.
- Edit the
gradle.properties
file as necessary for your machine. Theniagara_home
andniagara_user_home
variables should have the same values for these exercises as they do for the labs in class. Also make sure thatnodeHome
is set to the location of your installation of Node.
These steps must be completed for each exercise you want to submit.
- Navigate to the directory on your machine where you cloned your forked repository.
- Create a new branch to hold your changes and check it out. One way to do this is with the command
git checkout -b <branch_name>
, where<branch_name>
is something descriptive about the changes that will be on your branch. - Complete the exercise, including any coding, testing, etc. When compiling, use the Gradle command to only compile the module that you're currently working on. This will avoid issues compiling exercises that you haven't completed yet. The general command is
gradlew :<modulePartName>:jar
. For instance, for Exercise 1, that command isgradlew :myFile-rt:jar
. - When you're ready to submit your code for review, create one or more commits holding your changes. A simple way to do this is to run the command
git add .
from the repository root to add all of your changes to staging, then run the commandgit commit -m "<commit_message>"
to make a commit containing your changes. - Push your commit(s) to your forked repository in GitHub with the command
git push
. If your local branch isn't tracking an upstream branch, you may need to use the commandgit push --set-upstream origin <branch_name>
- In a web browser, navigate to your forked repository. Switch to the branch that you just pushed, then click the Contribute button and choose to open a Pull Request.
- Fill out the Pull Request form and submit the Pull Request.
- Your instructor will review your Pull Request and provide feedback on your code. Feel free to also look at other students' pull requests and the feedback on their code to get diverse ideas about how to solve the exercise!