can't push upstream using EGit

我与影子孤独终老i 提交于 2019-12-28 19:16:18

问题


I use EGit in eclipse to pull and push.

my config is:

  [remote "origin"]  
    fetch = refs/heads/*:refs/remotes/origin/*
    push = refs/heads/*:refs/remotes/origin/*

local branch is master Remote Tracking branch is origin/master

when I do push, it comes out "origin/master:master[up to date]". Actually the remote branch is not up to date. I wander if I configure the wrong way.

Sometimes I change different configure, I will get either "create a new branch"(which is wrong, as I just push some commits) or "reject-no fast forward"(which is strange, as I am the only user of the remote repository and I have already fetch before push)


回答1:


Check with Egit if you aren't in a detached HEAD mode:

If HEAD is "detached", i.e. is not pointing to the tip of a local branch but to a commit or tag, then none or several "checked-out" markers may appear in the tree, since any number of remote branch or tags may point to the currently checked out commit.
The state you are in while your HEAD is detached is not recorded by any branch (which is natural --- you are not on any branch).

(See "Why did git detach my head?" for probable cause, and "Git: How can I reconcile detached HEAD with master/origin?" for reconciliation).

That is a common cause for an "up to date" message when pushing to a remote repo.




回答2:


After I push to upstream successfully, like version 0.3.9, I continue to change my codes locally and submit a version 0.5.0. This submit should based on version 0.3.9. I don't know why. That's why I have to do merge every time, and sometimes merge make my codes messy.



来源:https://stackoverflow.com/questions/12171261/cant-push-upstream-using-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!