Activity for practicing with git and issues on GitHub.
For this activity, the students will practice making changes to a GitHub repository. The repository has a text file that has been "scrambled" - meaning that random words have had their characters randomly rearranged, and considered to be issues to be fixed.
The students will:
-
Fork the repository
-
Clone the repository
-
Add the original repository as an upstream remote:
git remote add upstream [email protected]:CS-Worcester-CS-348-SP-2018/git-issue-activity.git
-
Repeat as often as possible during the class:
- Assign themselves to an issue on GitHub (e.g. issue #42)
- Make sure you are on the Master branch:
git checkout master
- Create a branch named for the issue (e.g.
issue-42
), and switch to that branch:git checkout -b issue-42
- Edit the
LICENSE.txt
file to correct the issue - Add the change
- Pull any changes that have ocurred since their last pull, and correct merge conflicts
git pull upstream master
- Commit the change, with a message describing the change (include line number and correction, e.g.
Correct misspelling, line 1: UGN -> GNU
) - Push the change
git push origin issue-42
- Make a pull request to have their change merged into the original repository.
- On GitHub switch to the newly pushed branch.
- Click the
New Pull Request
button. - Include in the pull request text a notation that it closes the assigned issue (e.g.
Closes #42
) - Click
Create Pull Request
- Wait for the repository owner to accept the pull request.
The misspellings were generated by the twiddle.py
program and then entered as issues by the report.py
program (from this git-twiddler fork.