git - 如何在对跳过的文件进行更改的分支上签出
问题描述
我现在的分支是说branch_a
我local settings
使用以下命令跳过了文件。
git update-index --skip-worktree <file_local_settings>
现在我正在从另一个开发人员的仓库中提取一个分支,该开发人员已经更改了他的版本<file_local_settings>
并推送到了他的仓库。
当我尝试结帐到创建的分支时出现以下错误说branch_b
从他的分支创建的分支时,我收到以下错误。
error: Your local changes to the following files would be overwritten by checkout:
我的问题是什么是优雅的结账方式branch_b
?
解决方案
好的,所以我所做的就是跟随。
git update-index --no-skip-worktree <file_local_settings>
- 无论如何,我不想将我的更改推送到
<file_local_settings>
我跑 git reset --hard
#要小心,否则你可以这样做git checkout <file_local_settings>
- git结帐
branch_b
git update-index --skip-worktree <file_local_settings>
推荐阅读
- javascript - React Google Maps 不导入
- xml - 优化 Spark Scala 作业 - 许多任务、需要数小时的嵌套映射、XML 解析
- python - 如何在 Earth Explorer 的 API 请求中正确使用 POST
- powershell - 如何在powershell中拦截WM_QUIT?
- python - 生成与给定数组 x 相关的随机数 - 指定相关性并生成数字
- algorithm - 等分曲线下的面积
- pandas - 按从左到右的最小值对类和坐标的 Numpy ndarray 进行排序
- javascript - 我如何使用 Tampermonkey 更改文本?
- java - QuerySyntaxException: 表未映射 [更新表 BOMmodel 设置 PA13 = Materialvalue + ReqQTY ]
- arrays - 之前引用的局部变量