Commit case-change file renames

git mv -f

GPG sign commits

    email =
    signingkey = 00000000

Verify commits

git verify-commit c567d83

Rename branches

git branch -m old new


Executing local hooks from global hooks

#!/usr/bin/env bash

if [ -e ./.git/hooks/commit-msg ]; then
    ./.git/hooks/commit-msg "$@"


Hooks won’t work

chmod +x?

Push to upstream by default

Just set your push.default to upstream to push branches to their upstreams (which is the same that pull will pull from […]), rather than pushing branches to ones matching in name (which is the default setting for push.default — matching).

Brian Campbell on Stack Overflow

    default = upstream

Useful for easily pushing to a remote branch with a name different from that of the local branch. Long-form method:

git push origin local-branch:remote-branch


Generating patches

git format-patch --to head~..head

Applying patches

git apply 0001-Example.patch
git am 0001-Example.patch