如何在GitHub上合并远程更改?(How to merge remote changes at GitHub?)

系统教程 行业动态 更新时间:2024-06-14 16:57:39
如何在GitHub上合并远程更改?(How to merge remote changes at GitHub?)

我得到以下错误,首先尝试Github push:

[rejected] master -> master (non-fast forward) error: failed to push some refs to 'git@github.com:me/me.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'non-fast forward' section of 'git push --help' for details.

如何解决这个问题并合并远程更改?

I'm getting following error, whn trying first Github push:

[rejected] master -> master (non-fast forward) error: failed to push some refs to 'git@github.com:me/me.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'non-fast forward' section of 'git push --help' for details.

how can I fix this and merge remote changes?

最满意答案

有关详细信息,请参阅“ git push --help ”的“非快进”部分。

您可以执行“git pull”,解决潜在的冲突,并“git push”结果。 “git pull”将在提交A和B之间创建一个合并提交C。

或者,您可以使用“git pull -rebase”将您在A和X之间的更改重新移动,并将结果推回。 rebase将创建一个新的提交D,在A之上构建X和B之间的更改。

See the 'non-fast forward' section of 'git push --help' for details.

You can perform "git pull", resolve potential conflicts, and "git push" the result. A "git pull" will create a merge commit C between commits A and B.

Alternatively, you can rebase your change between X and B on top of A, with "git pull --rebase", and push the result back. The rebase will create a new commit D that builds the change between X and B on top of A.

更多推荐

本文发布于:2023-04-13 12:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/5621d82221110c8ce4c656c9ac65449a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   GitHub   remote   merge

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!