如何在GitHub上合并远程更改? [英] How to merge remote changes at GitHub?

查看:345
本文介绍了如何在GitHub上合并远程更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  [rejected] master  - >我得到以下错误,试着先尝试Github推送: master(非快速转发)
错误:无法将某些文件推送到'git@github.com:me / me.git'
为了防止您丢失历史记录,非快进更新拒绝
在再次推送之前合并远程更改。有关详细信息,请参阅'git push --help'的'非快进'
部分。

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

解决方案

查看' git push --help '以获得详细信息。


您可以执行git pull,解决潜在的冲突,并且git push结果。 git pull将在提交A和B之间创建合并提交C. 或者,您可以将A和B之间的X和B之间的更改重定义为 git pull --rebase,并将结果推回。 rebase将创建一个新的提交D,它在A之上构建X和B之间的变化。



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?

解决方案

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.

这篇关于如何在GitHub上合并远程更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆