What is the purpose of git update-index?

2

I was facing problems with folders, which should be ignored in the repository, but they were not even when I put it in .gitignore , and I did several searches to solve the problem.

Among the many searches I've seen someone advising that in some cases it's best to use git update-index --assume-unchanged than to use .gitignore .

I'd like to know what the purpose of this command is. What is it for?

And, noting that it uses the argument --assume-unchanged , are there any other arguments that can be used?

    
asked by anonymous 21.03.2016 / 15:13

1 answer

3

The update-index command updates the GIT index, the main use is to consider files modified as unmodified with the --assume-unchanged parameter. Another important parameter is --no-assume-unchanged , which undoes the previous command.

Another important command in this context is:

git ls-files -v | grep '^[[:lower:]]'

Used to list files marked as takes unchanged . Font .

Retrieved from the manual, the other parameters:

git update-index
    [--add] [--remove | --force-remove] [--replace]
    [--refresh] [-q] [--unmerged] [--ignore-missing]
    [(--cacheinfo <mode> <object> <file>)...]
    [--chmod=(+|-)x]
    [--[no-]assume-unchanged]
    [--[no-]skip-worktree]
    [--ignore-submodules]
    [--really-refresh] [--unresolve] [--again | -g]
    [--info-only] [--index-info]
    [-z] [--stdin] [--index-version <n>]
    [--verbose]
    [--] [<file>...]

The description of each of the parameters can be found at link

    
24.03.2016 / 12:09