Created
October 4, 2013 20:03
-
-
Save jwhitley/6831912 to your computer and use it in GitHub Desktop.
git-embargo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# This is a utility wrapper around git update-index used to mark, unmark, and | |
# list files that are marked with the assume-unchanged bit. See `git help | |
# update-index` for details. | |
# | |
# Usage: | |
# git embargo <FILE> # Mark a file as embargoed -- changes won't appear in status | |
# git embargo -r <FILE> # Remove the embargo | |
# git embargo -l|--list # List all embargoed files | |
case $1 in | |
-l|--list) | |
git ls-files -v | grep '^[a-z]' | |
;; | |
-r|--remove) | |
shift | |
git update-index --no-assume-unchanged -- $* | |
;; | |
*) | |
git update-index --assume-unchanged -- $* | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment