GIT untrack 文件

对于未进入版本库的文件可以在项目下建立一个.git-ignore的文件,如果已经有,就不需要建立了,在此文件内把文件目录或者文件名写进去。

对于已经进入版本库的文件,可以用如下的GIT命令进行UNTRACT

git update-index --assume-unchanged 文件

如果要恢复这些文件,可以用如下命令

git update-index --no-assume-unchanged 文件

 如下update-index其它命令, 可以用git update-index --help调出

git update-index [--add] [--remove | --force-remove] [--replace]

[--refresh] [-q] [--unmerged] [--ignore-missing]

[(--cacheinfo <mode> <object> <file>)…]

[--chmod=(+|-)x]

[--assume-unchanged | --no-assume-unchanged]

[--skip-worktree | --no-skip-worktree]

[--ignore-submodules]

[--really-refresh] [--unresolve] [--again | -g]

[--info-only] [--index-info]

[-z] [--stdin] [--index-version <n>]

[--verbose] [--] [<file>…]

猜你喜欢

转载自lvjun106.iteye.com/blog/1830875