git - 如何做integrate the remote changes

查看:1304
本文介绍了git - 如何做integrate the remote changes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

git push origin master
出现报错。

error: failed to push some refs to 'git+ssh://git@github.com/yufeiluo/newstart.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.

我这样解决了,
git push -f origin master
现在想用提示的方法解决
You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
如果全部git pull回来,那不就把本地的覆盖了?

我是新手,赐教

解决方案

1.如果是本地分支和远程分支可以自动合并这个时候可以直接commit,然后push这样就可以了
2.如果不一样就需要先git pull,但是这个命令会自动合并分支,可以使用git fetch,然后手动合并然后git push

这篇关于git - 如何做integrate the remote changes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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