为什么在 git rebase 之后应该做:git add?

Yos*_*sef 1 git git-rebase

为什么在 git rebase 之后应该做:“git add changedfile”?

我的问题的更多解释:

  1. 添加命令获取文件到暂存不提交他

  2. git rebase --continue 在做什么?

谢谢

mea*_*gar 5

如果 Git 告诉你输入git rebase --continue,那是因为 rebase 没有完成。听起来您因为一个或多个冲突文件而停止了中间变基。

当您处于冲突状态时,您可以键入git status并查找“未合并的路径”和标记为“均已修改”的文件:

# Unmerged paths:
#   (use "git add/rm ..." as appropriate to mark resolution)
#
#   both modified:      README
Run Code Online (Sandbox Code Playgroud)

Git 要求您手动解决冲突文件,删除更改标记,然后git add <file>标记冲突已解决。这会将更改移动到暂存区,告诉 Git 将它们包含在重新定位的提交中,当重新定位继续时,它将生成该提交。

完成此操作后,您可以继续使用git rebase --continue.