Git to ignore the absence of a file
git update-index --skip-worktree filename
The
git update-index --skip-worktree command tells Git to ignore the absence of a file, avoid updating it when possible with commands that normally update much of the working directory (e.g. checkout, switch, pull, etc.), and not have its absence be recorded in commits.This can be useful for files that are managed by another system, such as a continuous integration server, or for files that you don't want to track in Git but still need to be able to access.
You can also use
git update-index --no-skip-worktree with multiple files. For example, to resume tracking the files .gitignore and README.md, you would run the following command:
Comments
Post a Comment