LinuxCommandLibrary

git-update-index

Modify index entries for tracked files

TLDR

Mark file as unchanged

$ git update-index --assume-unchanged [file]
copy
Mark file as changed
$ git update-index --no-assume-unchanged [file]
copy
Skip worktree
$ git update-index --skip-worktree [file]
copy
Refresh index
$ git update-index --refresh
copy
Add file to index
$ git update-index --add [file]
copy
Remove file from index
$ git update-index --remove [file]
copy

SYNOPSIS

git update-index [options] [files...]

DESCRIPTION

git update-index registers file contents in the working tree to the index. It is a low-level plumbing command used internally by `git add`.
The most common use is the `--assume-unchanged` flag, which tells Git to temporarily ignore changes to a tracked file. The `--skip-worktree` flag serves a similar purpose but is intended for files managed by sparse checkout.

PARAMETERS

--assume-unchanged

Ignore changes to file.
--no-assume-unchanged
Track changes again.
--skip-worktree
Skip worktree bit.
--no-skip-worktree
Clear skip-worktree.
--add
Add file to index.
--remove
Remove file from index.
--refresh
Refresh stat info.
--chmod mode
Set executable bit.

SEE ALSO

git-add(1), git-rm(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community