curl -kL https://raw.githubusercontent.com/sushantmane/git-tricks/master/git-setup.sh | bash && . ~/.bashrc
This allows auto-completion of git commands in terminal
curl -kL https://raw.githubusercontent.com/sushantmane/git-tricks/master/git-autocompletion.sh | bash && . ~/.bashrc
To display name of current branch in terminal prompt like this
[root (master) git-tricks]$
curl -kL https://raw.githubusercontent.com/sushantmane/git-tricks/master/git-show-branch.sh | bash && . ~/.bashrc
latest commit
git format-patch HEAD^ --stdout > bug_id.patch
or
a specific commit
git format-patch -1 <SHA1> --stdout > bug_id.patch
or
a specific sha1 hash to the topmost commits
git format-patch -<n> <SHA1> --stdout > bug_id.patch
To take a look at what changes are in the patch.
git apply --stat bug_id.patch
To check if this patch can be aplied cleanly.
git apply --check bug_id.patch
Now applay a patch
git apply < bug_id.patch
or
applay patch with sign off
git am --signoff < bug_id.patch