有时当我按下Windows版Github上的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操作,但由于任何原因都没有成功
- 工作副本是干净的。没有可以被同步覆盖的已更改文件,也没有冲突
- Git告诉我,一旦所有冲突都得到解决,就要继续rebase操作(尽管在这种情况下,没有冲突)
> git rebase --continue
Stray path/to/repo/.git/rebase-apply directory found.
Use "git am --abort" to remove it.
我这样做:
> git am --abort
之后,Rebase操作完成/中止,再次按下Github for Windows的Sync按钮成功推送提交。
我只是想知道,如果没有冲突,为什么同步操作首先会失败
我是面向Windows开发人员的GitHub之一。
GitHub for Windows生成了一个日志文件,可以帮助了解同步时发生了什么:
https://help.github.com/articles/accessing-the-github-for-windows-log
我很想看看为什么重新基准失败了,因为从其他细节来看,看起来所有都应该完成。。。
同步操作首先失败?
因为GUI不希望静默地完成重新基准,而是希望确保用户知道所述重新基准。