TBGit is a command-line utility to facilitate the management of multiple GitHub student repositories.
- created by Charlie Proctor at 2014 YEI Tech Bootcamp
$ gem install tbgit
Commands:
- setup sets up a tbgit environment. See decription below
- push pushes all local student branches to their remote master branches
- pull pulls all remote master branches to local student branches
- merge merges a specified branch with each student branch and then commits the changes
- status runs `git status` on each students branch and displays the results
- each executes a specified series of commands on each local student branch
- spec runs rspec on specified files in a students repo
- add-remotes adds each student's repository as a remote
- create-locals creates a local branch to track the students remote master branch
- these are both part of the setup process
##TBGit Environment
- it's a regular git repository -- with lots of fancy features!
- there is a master branch for teachers to work off of (create hw files, etc..)
- teachers can obviously create and work off other branches if desired
- each student's repository is a remote of the git repo
- there is a local branch to track each student's remote master branches
##Setup
- Teachers create the student repositories (https://github.com/education/teachers_pet works perfectly well for this)
- initialize these repos with a README or push out a starter file.
- create a file with a list of the students github usernames (one on each line)
- you will need this during the setup process
- Teachers create a repo for themselves. This will serve as the base for the tbgit environment.
- Change to that repo's directory, execute
tbgit setup
, and follow the instructions.
##A Typical Workflow
- Teachers create the assignment (on the master branch) and make a final commit when they're ready to deploy it
- Teachers pull all the students' repos to make sure they're up to date.
tbgit pull
- Teachers merge their master branch with each student's local branch
tbgit merge
- At this point, teachers should check to make sure their were no merge conflicts. If there were, go in and fix them.
- feel free to
git checkout <username>
a few different branches
- feel free to
- Teachers push each students local branch to the student's remote master branch
tbgit push
- Make sure it worked. Do a victory lap.
To view student solutions at any point, just tbgit pull
and git checkout <username>
- Fork it ( https://github.com/[my-github-username]/tbgit/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request