首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法提交对Github页面的更改

无法提交对Github页面的更改
EN

Stack Overflow用户
提问于 2020-03-02 04:59:13
回答 1查看 151关注 0票数 1

我已经将我的投资组合部署到我在a.github.io上的帐户。

我做了一些修改,但它们不会在网站上上线。事实上,即使我在visual studio上做了更改,提交部分也没有显示任何提交。

如果我提交更改,我会得到

代码语言:javascript
运行
复制
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
modified: node_modules/gh-pages/.cache/github.com!a!a.github.io.git (new commits)

no changes added to commit 

即使我在做改变。

所以我的更改不会生效。

编辑:

现在,提交起作用了,但当我推送更改时,我会得到以下结果:

代码语言:javascript
运行
复制
 ! [rejected]          master -> master (fetch first)
error: failed to push some refs to 'https://github.com/a/a.github.io.git'
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.
EN

回答 1

Stack Overflow用户

发布于 2020-03-02 05:00:50

如果您做了任何更改,git状态应该会显示它们,并且您应该在某个时刻执行git add + git commit。

如果推送仍然失败,请检查git状态是否显示分支。

如果不是,则处于模式,这可以解释为什么不推送提交。

代码语言:javascript
运行
复制
git switch -c tmp
git switch -C master tmp

这随后会将主节点重置为当前(分离头部)提交。

如果你得到:

代码语言:javascript
运行
复制
new file...

您至少需要执行git add+git commit,但再次,请仔细检查当前分支。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60479721

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档