Skip to content

Instantly share code, notes, and snippets.


Matthew J. McCullough matthewmccullough

View GitHub Profile
matthewmccullough / gist:47267
Created Jan 15, 2009 — forked from halbtuerke/gist:31934
Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)
View gist:47267
View gist:885658
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
This file will also available in other languages:
Chinese -
schacon / gist:942899
Created Apr 26, 2011
delete all remote branches that have already been merged into master
View gist:942899
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
schacon / auto-backup.rb
Created May 12, 2011
Example Scripts from Three Trees Talk
View auto-backup.rb
back_branch = 'refs/heads/backup'
`rm /tmp/backup_index`
ENV['GIT_INDEX_FILE'] = '/tmp/backup_index'
last_commit = `git rev-parse #{back_branch}`.strip
last_tree = `git rev-parse #{back_branch}^{tree}`.strip
`git add --all`
next_tree = `git write-tree`.strip
schacon /
Created Aug 18, 2011
plumbing cheat sheet

the plumbing commands

  • rev-parse [something]

    • show the SHA of any weird git phrase
  • hash-object -w [file]

    • take any file or stdin and return a blob sha
  • ls-tree (-r) [sha]

    • show the entries of a git tree in the db
matthewmccullough / Writing Tools
Created Jan 13, 2012
How To Write A Technical Book (One Man's Modest Suggestions)
View Writing Tools
Dierk / pre-receive.groovy
Created Feb 9, 2012
a pre-receive hook to allow both: feature branches and agile CI
View pre-receive.groovy
// a git pre-receive hook
// that automatically merges all pushes to feature branches
// into a dedicated continuous-integration (ci) branch.
// Since we cannot merge in a bare repo, we work on a temporary clone.
// Dierk Koenig
def ciBranch = 'master'
def mergeName = 'merge'
def hereDirPath = new File('.').canonicalPath
mtnygard / gist:2254147
Created Mar 30, 2012
Books I recommended today
View gist:2254147
schacon /
Created Apr 9, 2012
shell command to get a GitHub OAuth token
# sh user pass
curl -s -d '{"scopes":["repo"],"note":"admin script"}' -u "$1:$2" -XPOST | grep token
tkarpinski / github_issues_to_csv.rb
Created Apr 12, 2012 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
View github_issues_to_csv.rb
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
# Project you want to export issues from