Skip to content

Instantly share code, notes, and snippets.

@jeremyjarrell
Created March 16, 2012 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyjarrell/2051970 to your computer and use it in GitHub Desktop.
Save jeremyjarrell/2051970 to your computer and use it in GitHub Desktop.
Compares the production to qa branches for differences
def compare_branches(source, destination)
begin
IO.popen 'git fetch'
gitdiff = `git diff --name-status #{source}..#{destination}`
rescue
raise "git unavailable"
end
if (!gitdiff.empty?)
raise "Branches do not match!\n" + gitdiff
end
end
task :compare_production_to_qa do
compare_branches('origin/production','origin/qa')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment