有时当我在 Github for Windows 上按下 Sync
按钮时,它会告诉我:
Failed to sync this branch
You might need to open a shell and debug the state of this repo
然后我转到控制台并输入 git status
。大多数情况下,当发生这种情况时,git status
会告诉我以下信息:
> git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working directory clean
如果我理解正确,那么:
- Github for Windows 启动了 Rebase 操作,但由于某种原因没有成功。
- 工作副本是干净的。没有可以被 Sync 覆盖的已更改文件,也没有冲突。
- Git 告诉我在解决所有冲突后继续 rebase 操作(尽管在本例中没有冲突)。
> git rebase --continue
发现杂散路径/to/repo/.git/rebase-apply 目录。
使用“git am --abort”将其删除。
我这样做:
> git am --abort
之后,Rebase 操作完成/中止,再次按下 Github for Windows 的 Sync 按钮成功推送提交。
我只是想知道,如果没有冲突,为什么同步操作首先会失败?
最佳答案
我是 Windows 开发人员的 GitHub 之一。
GitHub for Windows 生成了一个日志文件,可帮助了解同步时发生的情况:
https://help.github.com/articles/accessing-the-github-for-windows-log
我很想知道 rebase 失败的原因,因为根据其他细节判断,它看起来应该完成......
关于Github for Windows 将 repo 置于 "rebasing"状态,但显示为 "failed to sync this branch",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25884373/