Skip to content

Instantly share code, notes, and snippets.

@rawsyntax
Last active December 26, 2015 09:29
Show Gist options
  • Select an option

  • Save rawsyntax/7129614 to your computer and use it in GitHub Desktop.

Select an option

Save rawsyntax/7129614 to your computer and use it in GitHub Desktop.
set git user email automatically
#!/usr/bin/env ruby
work_email = 'eric@intridea.com'
if `pwd` =~ /^\/Users\/eric\/src\/intridea/ &&
`git config --get user.email`.strip != work_email
`git config --add user.email #{work_email}`
end
#!/usr/bin/env bash
git config --global init.templatedir ~/.git_templates
mkdir -p ~/.git_templates/hooks
@rawsyntax

Copy link
Copy Markdown
Author

put post-checkout in ~/.git_templates/hooks and make executable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment