Skip to content

Instantly share code, notes, and snippets.

@bkono
Created January 10, 2010 23:27
Show Gist options
  • Save bkono/273857 to your computer and use it in GitHub Desktop.
Save bkono/273857 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
if ENV['GIT_DIR'] == '.'
Dir.chdir('..')
ENV['GIT_DIR'] = '.git'
end
old_head, new_head, ref = STDIN.gets.split
puts ref
`echo \"#{ ref }\" >> head.txt`
if ref == "refs/heads/prod"
Dir.chdir('PRODUCTIONLOCATIONPATH/prod/app/')
`echo pwd`
`git pull`
end
if ref == "refs/heads/dev"
Dir.chdir('DEVLOCATIONPATH/dev/app/')
`pwd`
`git pull`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment