Some useful git alias to improve people lives.

You add aliases just by adding [alias] section to your git configuration file. Many commands come straight from the Git Wiki.

Quickly apply a patch from patchwork

Go to patchwork and select the patch you want to try. You'll see a downloadable link in patch or mbox format. You can click on either links and download the patch for your convenience. You can also apply the patch directly if you have curl installed by running the following command (also wget -o works):

curl <url of your patch> | git am -s

This command can be easily aliased as

patch = !sh -c 'curl http://patches.libav.org/patch/$0/mbox/ | git am -s'

or

pw = !sh -c 'curl $0/mbox/ | git am -s'

To make it more generic.

git pw http:/my.patchwork.example/patch/id

See incoming changes

Before doing pull you can check what changes had been fetched.

new = !sh -c 'git log $0@{1}..$0@{0} "$@"'

This command instead will tell you which changes are going to be fast-forward after a fetch.

lc = log ORIG_HEAD.. --stat --no-merges


CategoryHowTo