This is a simple exercise to get familiar with using Git and GitHub. Students will collaborate to create a "Class Roster" where each person contributes their personal information. This will demonstrate branching, cloning, creating a PR, reviewing, and merging.
This assignment is due Sunday 9/10 at midnight.
- A computer with Git installed.
- A GitHub account.
- Instructor created a new public repository on GitHub called
git-exercise
. - The repo has a README.md that explains the project: "This is a collaborative roster. Each contributor should add their personal information."
- The repository is available at https://github.com/njit-prof-bill/git-exercise.
- The instructor will send an invite to this repository that will allow you to push your branch to GitHub. In order for him to send the invite, you must post your GitHub id in the Discord #General channel.
- Each student clones the repository to their local machine using:
git clone https://github.com/njit-prof-bill/git-exercise
Student may use the GitHub website for cloning, or may also use GitHub Desktop.
Each student creates a new branch to work on their information, replacing [student_name] with their own name:
git checkout -b add-info-[student_name]
Important You will get a zero for the assignment if you commit directly to the main branch!!
- Each student creates a new .md file named after themselves (e.g., bill-mccann.md).
- Inside the file, they add their personal information using markdown formatting.
- Commit the changes:
git add [your file_name].md
git commit -m "Added the information for [student_name]"
Make sure your document contains:
- Your name
- Your favorite programming language
- Your preferred IDE
- Your hobbies
- Your favorite cartoon from your childhood
- A favorite movie, book, music, or video game
- Your discord id
- Your GitHub id
You get an extra credit point if the information is formatted in a table (using markdown).
- Student pushes their branch to GitHub:
git push origin add-info-[student_name]
- Go to the git-exercise repository on GitHub, where you'll see a message about your recently pushed branch. Click "Compare & pull request."
- Fill out the PR details, explaining your addition, and then create the pull request.
- Paired up review each other's PRs.
- Reviewer looks over the info file in the PR, checking for any mistakes or suggestions. Type a message in the General channel use the @discord_name to tag the person.
- Reviewer checks to make sure that all the questions have been answered. Request changes if there are unaswered questions.
- Reviewer can leave comments on specific lines of code or on the PR as a whole.
- Once the review is complete, if changes are suggested, the author makes the necessary modifications in their local branch and then pushes the updates to the same branch. The PR will be updated automatically.
- Once the reviewer is satisfied with the changes and approves the PR, they merge the PR into the main branch.
- Ensure that information gets merged properly without any conflicts.
After their PRs have been merged, students should update their local main branch to have the latest changes:
git checkout main
git pull origin main