Git Tips

Remote Non-Bare Repository
Creating a non-bare repository on a remote location.

# Create the repository as usual on the remote location.
git init

# Setup the repository to update when pushing to it.
git config --local receive.denyCurrentBranch updateInstead

Reset Last Commit

# Command
git reset [--soft][--hard] [Revision]

# Reset last commit and keep the local changes.
git reset --soft HEAD~1

# Reset last commit without local changes.
git reset --hard HEAD~1