Troubleshooting GitHub Pages build failures——解决GitHub Pages部署失败问题

If your GitHub Pages site fails to build on our servers, we’ll send you an email letting you know about the failure. In most cases, we’ll be able to identify the exact file and error so you can fix it and push again.

如果你的GitHub Pages网站无法在服务器上部署,我们讲发送一封邮件给您,让您了解失败的原因。大多数情况下,我们能够找到发生错误的文件以及错误的类型,你可以修复问题并重新推送到GitHub。

Generic failures–一般故障

These build failures will not produce an email with specific file and error information. If you receive an email that simply says “Page build failed” with no further details, or your GitHub Pages site is not showing up after the first push, check for the following common errors:

这类错误不会在email中显示确切的文件及错误信息。如果你收到的邮件简单地显示“Page build failed”,且没有更多额外信息,或你的GitHub Pages网站在您推送到GitHub后并没有显示,请检查如下几个常见的错误:

Unverified email address–未认证的email地址

To trigger a build, the user who pushes a commit to the Pages repository must have a verified email address.

After you verify an email address, you’ll need to push to the repository again to trigger the build process on our servers. You can also contact GitHub support to manually run a build.



Deploy key used for push–推送所需的部署公钥

Pushes must come from a user account with a verified email address. You won’t trigger a build if you use a deploy key to push to an organization’s Pages repository.

Instead, you can set up a machine user as a member of your organization.



git合并多个commit的方法:git rebase -i


虽然看到博主都写了有关git rebase -i合并commit的博文,但为巩固知识也在自己的博客中稍微做一些解释。
过去总是使用git reset –soft回退到之前的状态,再commit后push -f强推到远程库,能够覆盖掉之前的commit。

但在团队协作时,每次commit前还需要rebase upstream,这会自动将一些其他人做的修改也自动merge到本地的源码中。如果此时希望覆盖前一次commit,reset到之前的状态后,再次commit的内容就包含了其他人的修改,这不是我们希望看到的。
因此,我们需要使用git rebase -i。


  • 1 git log查看所有commit的情况,找到自己想要合并的commit之前的那个commit的ssh码,比如43jk2l3ba343;
  • 2 git rebase -i 43jk2l3ba343,这样会弹出一个文本编辑器;
  • 3 修改pick为squash会将这个commit合并到前一个commit中,保存退出;
  • 4 提示写下新的commit message,之前的message可以用#注释掉,保存退出;
  • 5 此时再git log就会发现,两个commit被合并到一个commit中。


  • 如果两个或多个commit不是相邻关系,可以先git rebase -i一次,这次只调整commit的顺序而不做修改,时所有要修改的commit相邻,同时必须保持原有的先后顺序。第二次rebase与上面基本步骤相同。
  • 当然可以git commit –fixup结合git rebase -i –autosquash,食用风味更佳:)
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now