The Wayback Machine - https://web.archive.org/web/20180611004947/https://github.com/github/training-utils
Skip to content
A series of Bash and ZShell scripts useful when teaching about git and GitHub
Ruby Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
script note deps and provide scrpit to install them Jan 13, 2016
vendor/cache bundle package the gems so we don't deal with out of date versions later Aug 4, 2017
.gitignore note deps and provide scrpit to install them Jan 13, 2016
Gemfile ensure octokit is always 4.7 or greater Aug 4, 2017
Gemfile.lock ensure octokit is always 4.7 or greater Aug 4, 2017
LICENSE.txt License > License.txt Jan 15, 2015
README.md Update the fork link Aug 31, 2016
Rakefile Add additional folders/files to excludes Apr 19, 2016
add-collaborators Use more properful englishization hereabouts Oct 6, 2015
add-to-org.rb sometimes your token is no longer valid, catch it Aug 8, 2017
common.rb Cleanup and move common code to common.rb Aug 12, 2015
create-assigned-issue But actually work correctly Aug 26, 2015
generaterandomchanges Renamed all scripts to have no filename extension Nov 27, 2011
generaterandomfiles Renamed all scripts to have no filename extension Nov 27, 2011
git-graphlive Simplify git-graphlive (defaults to 10 commits) Jan 15, 2015
historytailbash Added history scripts Aug 30, 2012
historytailzprezto Create file for ZPrezto Aug 10, 2016
historytailzsh More flexibly trim off the history's entry number Feb 14, 2013
transpose Rely heavily on Ruby's CSV for rendering CSVs Jun 14, 2016
transpose-csv.rb Rely heavily on Ruby's CSV for rendering CSVs Jun 14, 2016
treelive Improved treelive to accept parameters Oct 21, 2012
welcome welcome should ask for name Jan 15, 2015

README.md

Training::Utils

This is a package of git- and github-training scripts into an easily-installed package. This collection of utilities originated here.

Installation

If you have Ruby >= 1.9 installed, you can install these scripts into a directory in your $PATH by running:

$ script/bootstrap

Usage

generaterandomchanges <N> <base> <extension>

Generates N new commits, the content of each is a new file named "<base><I>.<extension>" with some random text.

$ generaterandomchanges 3 file txt
[master f377b54] A random change of 27129 to file1.txt
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 file1.txt
[master fd0965c] A random change of 15808 to file2.txt
1 file changed, 1 insertion(+)
create mode 100644 file2.txt
[master a704698] A random change of 26224 to file3.txt
1 file changed, 1 insertion(+)
create mode 100644 file3.txt

$ ls
README.md  file1.txt  file2.txt  file3.txt

$ git log --oneline
a704698 A random change of 26224 to file3.txt
fd0965c A random change of 15808 to file2.txt
f377b54 A random change of 27129 to file1.txt
ec9bce1 Add readme

generaterandomfiles <N> <base> <extension>

Generates N new files, each named "<base><I>.<extension>" with some random text.

$ generaterandomfiles 3 stuff txt

$ ls
README.md  stuff1.txt  stuff2.txt  stuff3.txt

$ git log --oneline
ec9bce1 Add readme

$ cat stuff1.txt
Some random text: 10660

git-graphlive <N optional, 10 default>

Perpetually loop git --no-pager log -<N> --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s' --abbrev-commit --date=relative. It's like "tail -f" for git log. It's sometimes useful to have this on a split screen, showing the git one-line, ASCII art git graph.

$ git graphlive 5
* 6cad0b4 - (HEAD, master) A random change of 19964 to file30.txt
* c9fd401 - A random change of 16742 to file29.txt
* d5794af - A random change of 22469 to file28.txt
* b2110a3 - A random change of 32088 to file27.txt
* 75d01a9 - A random change of 12572 to file26.txt

historytailbash and historytailzsh

Perpetually loop through history. It's like tail -f for history. Comes in bash and zsh flavors. It's sometimes useful to have this on a split screen, showing the recent history of commands.

transpose <file>.csv

Generate a transposed *.csv file from an input file.

treelive <depth>

Perpetually loop tree, up to depth folders deep in the hierarchy.

welcome <name>

Prints a welcome message:

-------------------------------------------------
Welcome to class on: Wed Jan 14 17:00:35 CST 2015
I'm Instructor Name Here, your instructor
-------------------------------------------------

Other Useful Apps

When training, we use lots of other apps. Here are some of our favorites:

Contributing

  1. Fork it ( https://github.com/github/training-utils/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.