Skip to content

Instantly share code, notes, and snippets.

@matriphe
Last active May 16, 2022 10:37
Show Gist options
  • Save matriphe/a1ba257bb2cacb8c68f8c0f93252dcff to your computer and use it in GitHub Desktop.
Save matriphe/a1ba257bb2cacb8c68f8c0f93252dcff to your computer and use it in GitHub Desktop.
Git Hide / Unhide

Based on https://stackoverflow.com/a/25387310

git config --global alias.hide 'update-index --assume-unchanged'
git config --global alias.unhide 'update-index --no-assume-unchanged'
git config --global alias.hidden '! git ls-files -v | grep '^h' | cut -c3-'

Usage

git hide {file}
git unhide {file}
git hidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment