【问题标题】:Git hub, working on multiple branches [duplicate]Github,在多个分支上工作[重复]
【发布时间】:2016-01-15 00:30:52
【问题描述】:

我有 2 个特性分支 feature1、特性 2,它们都来自开发分支。

在 feature1 中,我有一些新创建的文件。 不确定当我从开发分支分支功能 2 时我错在哪里,功能 1 中的新文件可以在功能 2 中看到。 在 feature1 中还更改了 1 个文件,这些更改也显示在 feature2 中。 我不希望 feature2 中的新文件,我也不希望在 feature 1 中更改文件,因为我想为 feature2 单独更改此文件。 请帮忙。

当 GIT Bash 指向开发分支时用于创建功能分支的命令是 git checkout -b 功能1 git checkout -b feature2

【问题讨论】:

    标签: git github git-branch git-checkout


    【解决方案1】:

    如果更改存在于工作副本中但未在功能 1 中提交,并且您切换到功能 2,则更改仍将可见。 git 还应该把它们放在哪里?在切换分支之前,提交更改,或使用git stash 将它们放在一边。

    【讨论】:

      猜你喜欢
      • 2021-04-18
      • 1970-01-01
      • 1970-01-01
      • 2021-11-06
      • 2016-12-24
      • 2019-09-06
      • 2012-09-29
      • 2016-01-14
      • 2012-11-07
      相关资源
      最近更新 更多