Git命令:git update-index

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/myNameIssls/article/details/82726981

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

参考链接:
https://git-scm.com/docs/git-update-index

猜你喜欢

转载自blog.csdn.net/myNameIssls/article/details/82726981