Eclipse 如何在gitHub将现有的本地分支推送到远程?

Eclipse 如何在gitHub将现有的本地分支推送到远程?,eclipse,git,version-control,github,Eclipse,Git,Version Control,Github,我正在使用sourceTree 如何将现有的本地项目(分支)推送到 我赢了一个远程Gitbug存储库 我尝试获得以下错误: git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream memPic master:master Pushing to https://github.com/elad2109/memPic.git To https://github.com/elad210

我正在使用sourceTree

如何将现有的本地项目(分支)推送到

我赢了一个远程Gitbug存储库

我尝试获得以下错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream memPic master:master 
Pushing to https://github.com/elad2109/memPic.git
To https://github.com/elad2109/memPic.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/elad2109/memPic.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Completed with errors, see above

但无论如何,我不确定需要执行哪些步骤?

这是失败的,因为您的分支尖端在其遥控器后面。如果存在不带重基的获取,则可能发生这种情况


有两种修复方法。要保留远程更改,请在命令之前添加
git-rebase
。若要放弃其他更改(不推荐),请在push命令中添加一个
-f

这不是github问题,而是git问题。如果不合并/重定基址,则无法进行非快进推送。请检查文档的相应部分

网站是一个伟大的帮助了解问题

因此,您基本上要么必须
git-pull
要么
git-pull--rebase

可能重复的