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

标签 git github

第一次尝试 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/

相关文章:

android - 如何在 Windows 中使用 git bash 克隆 Android 项目

git - 在github上找一个force push的committer

git - 应该在提交历史中保持 merge 吗?

github - 如何将附件上传到 GitHub wiki?

github - 如何从 GitHub Web 更新 fork 的 repo?

git - 查看( list )在本地和远程分支之间更改的文件-git

php - Git POST webhook shell_exec

git cherry-pick 远程无分支提交

git - 使用 Visual Studio 2019 将更改推送到子存储库

github - 如何隐藏 GitHub wiki 页面上某些页面的侧边栏?