【发布时间】:2020-06-17 01:33:15
【问题描述】:
我已将我的 github 网站部署到 a.github.io。现在,我在本地进行了一些更改并想推送更改,但我无法这样做。这是我的 repo 设置在 Github Pages 部分中所说的:
在我的仓库中,我可以看到提交正在显示。但是,该网站仍然没有更新。如果我在本地运行它,我会看到更改,但不会在实际网站上看到。请注意,它托管的网站的原始帐户也与我进行提交的帐户不同。
当我通过终端访问本地仓库并运行时
git config --list
我收到的不是我的用户名和电子邮件,而是我的两个不同帐户的两封不同的电子邮件。第一个 user.name 基本上是我托管网站的电子邮件地址。 user.email 是我用来推送更改的电子邮件。
user.name=ab@hotmail.com user.email=ab@gmail.com
这就是我尝试更新网站的方式(上次推送工作但它甚至不工作):
git add *
git commit -m "added new picture"
结果:
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
deleted: favicon.ico
deleted: logo192.png
deleted: logo512.png
deleted: z<
no changes added to commit
git push
结果:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/aa
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.
然后npm run deploy
【问题讨论】:
-
@phd 不,即使推送成功,网站也不会实时进行更改
标签: git ubuntu github github-pages git-commit