在使用Git的时候会遇到本地有一个需要长久的修改,但是不想提交到服务器,但是又想服务器上文件有更新时能同步到本地,这时我们可以使用如下的命令。
忽略文件本地修改
1 | git update-index --skip-worktree <file> |
撤销忽略
1 | git update-index --no-skip-worktree <file> |
在使用Git的时候会遇到本地有一个需要长久的修改,但是不想提交到服务器,但是又想服务器上文件有更新时能同步到本地,这时我们可以使用如下的命令。
忽略文件本地修改
1 | git update-index --skip-worktree <file> |
撤销忽略
1 | git update-index --no-skip-worktree <file> |