How to git check if merging is required?

According to the documentation , git update-index --refresh does the following:

Accesses the current index and checks to see if merges or updates are needed by checking the stat () information.

What does it mean that git "checks to see if merges or updates are needed? Does git support an arbitrary flag saying" mergeme "after certain operations?

Also, I think I understand stat ( what is the “statistics information” in the git index? ), But I don’t see how knowing something like the UID hint git generally knows if a merge should happen.

+8
git git-merge
source share
1 answer

The description is a bit misleading. This command checks if the working copy is different from the index. In this context, merging means you will need to use git add , git rm or git checkout to synchronize the index and the working copy. This has nothing to do with git merge .

The index stores a snapshot of the stat working file information in order to optimize user detection of changes. It is updated every time these changes are inserted into the intermediate area ( git add , git rm ) or when the working copy modification is canceled ( git checkout , git reset , ...).

+2
source share

All Articles