git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Detached HEAD problem

From
MYM Yep <myep01@yahoo.com>
Date
Apr 24, 2012, 20:10 UTC
Message-ID
<1335298250.31016.YahooMailClassic@web125404.mail.ne1.yahoo.com>
Hello

I have been working on a project and I realized somewhere I introduced a bug.

I found the closest save point to where i was, i believe it was HEAD -2, and checked it out.

I then laid in several commits, and now i cant push

here is a view of my history, and the commands i executed to get into this state

HISTORY (time flows up)
* 1bc1ffb current state
* 735d64f
* 07dd73d Project working again
* c70627c
* 4c6a8ea
* 2828db4
* c38ef0b
| * 1815aac
| | * fe6e0ac Version bump
| | * 32de1e5 BROKE
| | * 528cb37 Bug introduced?
| |/
| * ef4ff7e
|/
| * ef4ff7e
|/
* 8238b14 GOOD
.
.
.
COMMANDS (time flows down)

PUSH 8238b14 GOOD PUSH ef4ff7e PUSH 528cb37 Bug introduced? PUSH 32de1e5 BROKE PUSH fe6e0ac BROKE Version bump CHECKOUT master -> ef4ff7e CHECKOUT ef4ff7e -> dev COMMIT 1815aac CHECKOUT dev -> 8238b14 COMMIT c38ef0b COMMIT 2828db4 COMMIT 4cba8e9 COMMIT c70627c COMMIT 07dd73d Project OK again CHECKOUT 07dd73d -> mvp1 CHECKOUT mvp1 -> master COMMIT 735d64f COMMIT 1bc1ffb current state

now when i try to push:
user@host:~/workspace/project$ git push
To git@github.com:xxxxxxxxxxxxx.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:xxxxxxxxxxxxxxxxxxx.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

user@host:~/workspace/project$ git status # On branch master # Your branch and 'origin/master' have diverged, # and have 7 and 4 different commit(s) each, respectively. # nothing to commit (working directory clean)

user@host:~/workspace/project$ git branch
 dev
* master
 mvp1
 noopt
 temp
Any help would be great.
Thanks
Mike
Next: Eugene Sajine
Message 1 of 2 in “Detached HEAD problem”
  1. M YepApr 24, 2012
  2. Eugene SajineApr 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.