Git命令:git update-index

本文详细介绍了Git中update-index命令的使用方法及参数,包括如何通过此命令忽略特定文件的版本控制,以及如何恢复被忽略的文件重新纳入版本控制。适合于需要精细控制Git仓库文件状态的开发者。
部署运行你感兴趣的模型镜像

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

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

[user@localhost fep_switch]$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git submodule update --init --recursive 10:58:46.520579 git.c:725 trace: exec: git-submodule update --init --recursive 10:58:46.520616 run-command.c:655 trace: run_command: git-submodule update --init --recursive 10:58:46.531510 git.c:439 trace: built-in: git rev-parse --git-dir 10:58:46.533318 git.c:439 trace: built-in: git rev-parse --git-path objects 10:58:46.536000 git.c:439 trace: built-in: git rev-parse --show-prefix 10:58:46.537084 git.c:439 trace: built-in: git rev-parse --show-toplevel 10:58:46.540258 git.c:439 trace: built-in: git submodule--helper update --recursive --init -- 10:58:46.542987 run-command.c:1524 run_processes_parallel: preparing to run up to 1 tasks 10:58:46.543012 run-command.c:655 trace: run_command: git submodule--helper clone --path ldk_marvell/cpss_work_4.3.10 --name ldk_marvell/cpss_work_4.3.10 --url ssh://shengmingde@gerrit.ep.tp-link.com:29418/SMB/SWITCH/SDK/cpss_work_4.3.10 10:58:46.544305 git.c:439 trace: built-in: git submodule--helper clone --path ldk_marvell/cpss_work_4.3.10 --name ldk_marvell/cpss_work_4.3.10 --url ssh://shengmingde@gerrit.ep.tp-link.com:29418/SMB/SWITCH/SDK/cpss_work_4.3.10 10:58:46.544425 run-command.c:655 trace: run_command: unset GIT_PREFIX; GIT_DIR=.git git clone --no-checkout --separate-git-dir /project/fep_switch/.git/modules/ldk_marvell/cpss_work_4.3.10 -- ssh://shengmingde@gerrit.ep.tp-link.com:29418/SMB/SWITCH/SDK/cpss_work_4.3.10 /project/fep_switch/ldk_marvell/cpss_work_4.3.10 10:58:46.545324 git.c:439 trace: built-in: git clone --no-checkout --separate-git-dir /project/fep_switch/.git/modules/ldk_marvell/cpss_work_4.3.10 -- ssh://shengmingde@gerrit.ep.tp-link.com:29418/SMB/SWITCH/SDK/cpss_work_4.3.10 /project/fep_switch/ldk_marvell/cpss_work_4.3.10 Cloning into '/project/fep_switch/ldk_marvell/cpss_work_4.3.10'... 10:58:46.546841 run-command.c:655 trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL -p 29418 shengmingde@gerrit.ep.tp-link.com 'git-upload-pack '\''/SMB/SWITCH/SDK/cpss_work_4.3.10'\''' 10:58:50.629573 run-command.c:655 trace: run_command: git index-pack --stdin --fix-thin '--keep=fetch-pack 48930 on localhost.localdomain' --check-self-contained-and-connected 10:58:50.630737 git.c:439 trace: built-in: git index-pack --stdin --fix-thin '--keep=fetch-pack 48930 on localhost.localdomain' --check-self-contained-and-connected 请分析问题
08-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值