Skip to content

Instantly share code, notes, and snippets.

todgru /
Last active Nov 10, 2018
Todd's git branch info! merge move delete ours fix conflicts rebase
todgru / Bcrypt.php
Created Sep 7, 2012 — forked from marcoarment/Bcrypt.php
Simple PHP 5.3+ Bcrypt class and functions php bcrypt
View Bcrypt.php
By Marco Arment <>.
This code is released in the public domain.
Usage example:
// In a registration or password-change form:
todgru /
Created Nov 19, 2012
BASH OSX notes bash osx

Order of execution in OSX:

todgru /
Last active Oct 13, 2015
Git submodule


Here is how we do it at Our Office

When you clone your working repos (api, app, www), you'll have an empty Modules directory. The working repo will contain a pointer to the hash of the last Modules repo committed. All that needs to be done from your working repo directory is:

$ git subumodule init
todgru /
Created Nov 20, 2012
Clean up those .DS_store files
todgru / gist:4128695
Last active Apr 12, 2019
Git Keeps asking for username password clone ssh git https
View gist:4128695
todgru /
Created Nov 26, 2012
Ruby, Bundler, rvm and gems can be bitches

#The Big Headache.

A common error we get when attempting to run rake -T after a git pull is:

rake aborted!
cannot load such file -- some/gem_file
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/vlad-2.3.0/lib/vlad.rb:3:in `require'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/vlad-2.3.0/lib/vlad.rb:3:in `<top (required)>'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
todgru /
Created Dec 10, 2012
oops git reverse commit back out

#Oops, I merged untested changes to master!

You've made changes to master, commited and push up to your repo. Git is flexible enough that you can dig yourself out rather easily. Here are two of many options to get back to a safe place.

  • Option 1, Branch out and keep your changes.
  • Option 2, Reset the branch and lose changes.

The final step in both of these options is $ git push --force origin master.

##Option 1: Branch Out

todgru /
Created Dec 11, 2012
How to use git pull request

#How to use Pull Request


After you have branched from the mainline, made changes, commit to your branch and push your branch to the Github repo.

In the Github repo, select your branch from the drop down.

Click pull request......


#git tag

Think of a git tag as an alias to a sha1 or to a branch.

The Git Book on tagging says there are two main typs of tags, lightweight and annotated. Lightweight only records commit and tag. Annotated records who, what, when and where. Use annotated, -a.

List all tags:

$ git tag
You can’t perform that action at this time.