.gitignore doesn't stop changes being tracked in files

后端 未结 1 615
天命终不由人
天命终不由人 2021-01-31 11:26

Changes I make to a file that\'s within my .gitignore are being tracked by git.

File structure:

.gitignore
wp-config.php

C

1条回答
  •  感动是毒
    2021-01-31 11:55

    With .gitignore, only untracked files are ignored.

    Once the file has been added, change to that file are not ignored.

    In this case, you should use assume-unchanged or skip-worktree instead.

    git update-index --assume-unchanged -- wp-config.php
    

    or

    git update-index --skip-worktree -- wp-config.php
    

    0 讨论(0)
提交回复
热议问题