代码之家  ›  专栏  ›  技术社区  ›  Kishor Pawar

如何在对跳过的文件进行更改的分支上签出

git
  •  2
  • Kishor Pawar  · 技术社区  · 7 年前

    我现在的分公司是萨伊 branch_a

    我有 local settings 使用以下命令跳过文件。

    git update-index --skip-worktree <file_local_settings>
    

    现在我从另一个开发者的repo中提取一个分支,他已经修改了他的版本 <file_local_settings> 推到他的回购。

    当我尝试签出到创建的分支时,出现以下错误 branch_b

    error: Your local changes to the following files would be overwritten by checkout:
    

    我的问题是什么是优雅的结帐方式 分支机构 ?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Kishor Pawar    7 年前

    好吧,我所做的就是跟踪。

    1. git update-index --no-skip-worktree <file_local_settings>
    2. 无论如何,我不想把我的更改推到 <file_local_settings> 我跑了
    3. git reset --hard git checkout <file_local_settings>
    4. git签出 branch_b
    5. git update-index --skip-worktree <file_local_settings>