How to NOT commit locally deleted files to git -
we have situation using git stash myriad scans (images) , not wish preserve them on local machine once set on up; however, git seeing each local deletion (following process) committed repo, , want not happen. ideas on how commit additional files , never deletions?
use skip-worktree bit
the git-update-index(1) command provides ways of dealing this. based on assumption want keep blobs in history while deleting them working tree, use following:
git add --all git commit --message="add new assets repository." git update-index update-index --skip-worktree <files ...> rm <files ...>
note last line isn't git command because you're removing files working tree in shell after you've stored them in index. don't use git rm
mistake, because operates on index.
listing special bits , index-only files
to see files you've marked skip-worktree bit:
git ls-files -v | awk -v ignorecase=1 '$1 ~ /s/ {print}'
you can use git-ls-files(1) find files in index have been removed working tree.
Comments
Post a Comment