用Github Pages为自己的帐号搭建个人主页时添加CNAME到github仓库会遇到很多问题:
1.通过$ git push -u origin master命令把CNAME文件推送到远程库时出现如下错误:
To github.com:xxxxxxxx/xxxxxxx.github.io
! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]:xxxxxxx/xxxxxxxx.github.io'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[xxxxxxx处表示自己的github账号]【主要原因是github中的CNAME文件不在本地代码目录中】
解决办法:
使用git pull --rebase origin master进行代码的合并。
接着我在使用上述命令时又出现了如下错误:
error: cannot pull with rebase: You have unstaged changes.
erro