Skip to content

Instantly share code, notes, and snippets.

@joelcox
Created April 4, 2011 09:23
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 joelcox/901347 to your computer and use it in GitHub Desktop.
Save joelcox/901347 to your computer and use it in GitHub Desktop.
WIP git cheat sheet
#
# Various handy commands
#
# Change the author of the previous commit
git commit --amend --author="Name <name@domain.com>"
# Set a global .gitignore
git config --global core.excludesfile ~/.gitignore
#
# Deploy to live server by pushing (http://philsturgeon.co.uk/blog/2010/02/Deploying-websites-with-Git)
#
# Makes sure we can push to a checked out branch
git config receive.denyCurrentBranch ignore
# Post receive hook at .git/hooks/post-receive
#!/bin/sh
# Update the working tree after changes have been pushed
cd ..
env -i git reset --hard
# Makes sure it is executable
chmod +x .git/hooks/post-receive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment