Git命令:git update-index
语法:
git update-index
[--add] [--remove | --force-remove] [--replace]
[--refresh] [-q] [--unmerged] [--ignore-missing]
[(--cacheinfo <mode>,<object>,<file>)…]
[--chmod=(+|-)x]
[--[no-]assume-unchanged]
[--[no-]skip-worktree]
[--[no-]fsmonitor-valid]
[--ignore-submodules]
[--[no-]split-index]
[--[no-|test-|force-]untracked-cache]
[--[no-]fsmonitor]
[--really-refresh] [--unresolve] [--again | -g]
[--info-only] [--index-info]
[-z] [--stdin] [--index-version <n>]
[--verbose]
[--] [<file>…]
示例
提交代码时,忽略某一个文件不提交,即某个文件不被版本控制,例如config.propertites文件暂时不提交:
git update-index --assume-unchanged src/main/resources/config/test/config.propertites
如何恢复被忽略的文件重新被版本控制呢
git update-index --no-assume-unchanged src/main/resources/config/test/config.propertites
本文详细介绍了Git中update-index命令的使用方法及参数,包括如何通过此命令忽略特定文件的版本控制,以及如何恢复被忽略的文件重新纳入版本控制。适合于需要精细控制Git仓库文件状态的开发者。
604

被折叠的 条评论
为什么被折叠?



