From 7e6e8cac1d78ecf0ba81960145a0c8f4e72fddd8 Mon Sep 17 00:00:00 2001 From: Joel Kuzmarski Date: Sat, 10 Aug 2013 09:12:55 -0500 Subject: [PATCH] Add aliases to hide or show indexed files and dirs Uses `--assume-unchanged` and `--no-assume-unchanged` flags. --- modules/git/README.md | 3 +++ modules/git/alias.zsh | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/modules/git/README.md b/modules/git/README.md index 0dd932f6..a15f8e3b 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -84,6 +84,7 @@ Aliases - `gdm` lists modified files. - `gdu` lists untracked files. - `gdk` lists killed files. + - `gdh` lists hidden files. - `gdi` lists ignored files. ### Fetch @@ -113,6 +114,8 @@ Aliases - `giR` resets the current index interactively. - `gix` removes files/directories from the index (recursively). - `giX` removes files/directories from the index (recursively and forced). + - `gih` hides files/directories from the index. + - `gis` shows files/directories hidden from the index. ### Log diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index bf6d3644..31133ca8 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -3,6 +3,7 @@ # # Authors: # Sorin Ionescu +# Joel Kuzmarski # # @@ -72,6 +73,7 @@ alias gdx='git ls-files --deleted' alias gdm='git ls-files --modified' alias gdu='git ls-files --other --exclude-standard' alias gdk='git ls-files --killed' +alias gdh='git ls-files -v | grep "^h " | cut -d" " -f2-' alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"' # Fetch (f) @@ -98,6 +100,8 @@ alias gir='git reset' alias giR='git reset --patch' alias gix='git rm -r --cached' alias giX='git rm -rf --cached' +alias gih='git update-index --assume-unchanged' +alias gis='git update-index --no-assume-unchanged' # Log (l) alias gl='git log --topo-order --pretty=format:${_git_log_medium_format}'