Command line tools to help teachers use GitHub in their classrooms.
Each class is an 'organization' on GitHub. This allows the instructors (GitHub organization Owners) to create, push, pull, and administer all repositories. This achieves two goals:
- Instructors can push code starter code to all students
- Instructors can easily browse/pull student code at any time during the assignment to assist in questions, check on progress
Each student is given a team in the organization. The team name is the same as the student's GitHub username. The course instructors are also added as team members for each team (see the goals above).
Install Ruby 1.9.3 , then run
gem install teachers_pet
If you've used this tool before, get the newest version using
gem update teachers_pet
To use the latest-and-greatest code from this repository, see the instructions in CONTRIBUTING.md.
- Create an organization (you will be an owner by default). The organization should reflect the name of your course.
- Create a
students
file (you will be prompted for the path later)- Individual assignments: one username per line
- Group assignments: one team per line in the format
teamName username username username
- Add the GitHub username of all instructors to an 'instructors' file (one per line)
- Run
create_teams
The scripts will ask for your GitHub password in order to run. If you have two factor authentication enabled, create a personal access token (replace github.com
with your host for GitHub Enterprise):
Then, add the following line to your .bash_profile
:
export ghe_oauth="YOUR_TOKEN_HERE"
For each assignment, run create_repos
to create a repository for each student. The repositories are technically created per team, but if you use create_teams
first, then there will be one team per student.
Give collaborator access to everyone who has forked your repository.
teachers_pet fork_collab --repository=USER/REPO
Learn more with
teachers_pet help fork_collab
This is the workflow that we use. Create a private repository on GitHub. Clone it to your machine and place in all the necessary starter files (.gitignore and build files, like Makefile are highly recommended). Commit and push this repository to the origin.
While in the directory for the starter file repository, run the push_repos
script.
This works by creating a git remote for each repository and thing doing a push to that repository.
After running create_repos
, instructors can open issues in repos with open_issue
. This action requires an issue.md
file containing the body of the issue. The issue title and optional tags are added at runtime.
One issue will be opened in every repo defined by the students
file and repository name given by the user.
Open issues in student repos as a way to list requirements of the assignment, goals, or instructions for patching.
When grading, use the clone_repos
script to clone all the repositories in the organization that match the username-repository naming scheme that is generated when create_repos
is run.