How to ignore existing file in Git?

前端 未结 7 517
南笙
南笙 2021-02-05 19:31

I need to work on file.txt locally and in Git, with different content. I want Git not to tell me that there have been changes to that file.

Is this possible

7条回答
  •  难免孤独
    2021-02-05 20:13

    SOURCETREE Terminal codes

    Add ignore file:

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

    Extract ignore file:

    git update-index --no-skip-worktree index.php
    

    List ignore files:

    git ls-files . --ignored --exclude-standard --others
    

提交回复
热议问题