Git git git git git git git git git git
There is a necessary configuration file in the Git repository that should exist, but be modified locally for each developer. This causes the file to be modified repeatedly and prone to conflicts. To avoid conflict, it is necessary for everyone to deliberately not submit the document before submission, which is very troublesome. (For example, in TinkPHP, app.php debug mode, use true for development, but use false for production)
It would be tempting to ignore this file with.gitignore, but the file is already committed, is necessary for the project, and should be stored in Git. .gitignore is helpless for such submitted files. — — — — — — — — — — — — — — — — — — — — — — — —
Git update-index –skip-worktree
The purpose of this command is to make Git ignore a file when searching the list of files, so that git doesn’t care if the file changes.
Git update-index --skip-worktree config/app.php git update-index --skip-worktree config/app.phpCopy the code
Use this command, time is long, may forget oneself to ignore what files, then you can use the git ls – files – v. | grep “^ S” command to find out to ignore the file
# example: git ls - files - v. | grep "^ S # output:" S config/app. PHPCopy the code
Git update-index –no-skip-worktree if you don’t want to ignore this file any more, use git update-index –no-skip-worktree to make git not ignore this file any more.
Git update-index --no-skip-worktree config/app.php git update-index --no-skip-worktree config/app.phpCopy the code