2

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)

a busy cat a busy cat

Jenny
  • 107
  • 2
  • 11

2 Answers2

0

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

checked out branches in EGit

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I add some pictures. Do you still think I have a Detached Head? – Jenny Aug 29 '12 at 07:07
  • I made the change the tree messy, and how can I avoid this happen. It should like a single chain. – Jenny Aug 29 '12 at 07:13
  • @user1626792 you don't seem to be in a detached head, and your history is fine: it reflects the merge from remote to your repo (but your own repo history is linear). – VonC Aug 29 '12 at 07:21
  • @user1626792 However, you need to commit something in order to push it: right now, your HEAD doesn't reference any *new* commit compared to the remote. – VonC Aug 29 '12 at 07:22
  • the merged commit actually didn't contain any changes. it just what I have to do firstly, otherwise it would push successfully. But sometime when I do merge, it fails, and then could not push to the upstream. – Jenny Sep 11 '12 at 02:47
  • Is this information useful to you. I don't when merge will fail. Is it just a bug of EGit? – Jenny Sep 11 '12 at 02:49
  • @Jenny if the merge fails, it should fail because of conflict. Did you have issue resolving said merge conflicts? (http://www.vogella.com/articles/EGit/article.html#team_mergeconflicts) – VonC Sep 11 '12 at 04:10
  • When the merge fails, I will commit some new change, then do push to the upstream, sometimes it will successfully. – Jenny Sep 12 '12 at 07:39
  • Hi, I add a new clue in the additional answer. would you like to help me with the problem to avoid it happen again. – Jenny Sep 20 '12 at 00:18
0

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.

Jenny
  • 107
  • 2
  • 11