Created
April 4, 2011 09:23
-
-
Save joelcox/901347 to your computer and use it in GitHub Desktop.
WIP git cheat sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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