diff --git a/.README.md b/.README.md index 6f4cdf0..2e4cd81 100644 --- a/.README.md +++ b/.README.md @@ -516,11 +516,12 @@ Command|Description `gs`|Git status. `gst`|Git stash. `gd`|Git diff. -`gc [MESSAGE]`|Git commit. +`gdc `|Git diff for a specific commit. +`gc `|Git commit. `gch`|Git checkout. `gchb`|Git checkout branch. `gb`|Git branch. -`gbd [BRANCH]`|Delete specified Git branch. +`gbd `|Delete specified Git branch. `gbda`|Delete all local branches except the current one. `gf`|Git fetch --all. `gt`|Git tag. @@ -529,7 +530,7 @@ Command|Description `gp`|Git patch (apply). `ga`|Git add with preview. `gr [COUNT]`|Git rebase. 2 last commits by default. 0 means from root. -`gu [EMAIL]`|Configure git user as Dmitry Voronin with specified email (project). +`gu `|Configure git user as Dmitry Voronin with specified email (project). `gg `|Get git repo from my own git. ## Ls. diff --git a/.config/bash/module/git.sh b/.config/bash/module/git.sh index 4f9c615..005a43d 100644 --- a/.config/bash/module/git.sh +++ b/.config/bash/module/git.sh @@ -74,6 +74,13 @@ gg() git clone https://git.voronind.com/voronind/"${1}" } +# See diff for a specific commit. +# Usage: gdc +gdc() +{ + git diff "${1}^!" +} + # Show current branch. _git_current_branch() { @@ -89,6 +96,7 @@ __git_complete gl _git_log &> /dev/null __git_complete gs _git_status &> /dev/null __git_complete gst _git_stash &> /dev/null __git_complete gd _git_diff &> /dev/null +__git_complete gdc _git_diff &> /dev/null __git_complete gc _git_commit &> /dev/null __git_complete gch _git_checkout &> /dev/null __git_complete gchb _git_checkout &> /dev/null