GitHub for Windows提交失败“failed to sync this branch”

        今天github for windows同步推送远端github出问题了,提交到本地没问题,远端一直推送不上去,挺棘手的,试了几个网上的方法不管用。问题如下,报这个错:

failed to sync this branch.

You might need to open a shell and debug the state of this repo.

经过几轮摸索,终于找到一个解决方法,如下图所示,在github for windows界面点击右上角的设置图标,选择”Open in git Shell “打开Shell窗口

先用命令”git pull“拉去远程github上代码,再用"git push"把已经提交到本地的代码推送提交到远程github上即可,成功!

虽然能用shell命令窗口成功推送远端,但是这样还是没能解决github for windows可视化界面无法推送到远端github的问题,如有大神能解决,请多多指教。

原文地址:https://www.cnblogs.com/yige/p/5209190.html