gpt4 book ai didi

git - 如何在 GitHub 上 merge 远程更改?

转载 作者:IT王子 更新时间:2023-10-29 01:19:38 26 4
gpt4 key购买 nike

第一次尝试 Github 推送时出现以下错误:

[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.

我该如何解决这个问题并 merge 远程更改?

最佳答案

请参阅“git push --help”的“非快进”部分' 了解详情。

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.

关于git - 如何在 GitHub 上 merge 远程更改?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1713137/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com