Excluding files from git-diff

后端 未结 4 1969
情话喂你
情话喂你 2020-12-13 03:52

I am tracking a project with git. There are some Xcode project files in the working copy that I want to keep tracking, but do not want to see in diffs, because there are alw

4条回答
  •  死守一世寂寞
    2020-12-13 04:17

    Just incase someone else has the same pain we had. We wanted to exclude a file that had already been committed.

    This post was way more useful: working with .git/info/exclude too late

    Specifically what you need to ignore a file is actually use the command git remove See git rm (http://www.kernel.org/pub/software/scm/git/docs/git-rm.html)

    you test it by going

    git rm --dry-run *.log
    (if you say wanted to exclude all the log files)

    this will output what would be excluded if you ran it.

    then

    you run it by going

    git rm *.log
    (or whatever filename path / expression you want to)

提交回复
热议问题