2

I'm doing git log --all to show all the commits, but there last is not being shown...

Even, when I do push it says Everything up-to-date, and I expected to be able to push the last commitS.

I did git show-branch and it says:

[master] Merge branch 'master' of bitbucket.org:jargd/contract

Any help?

tirenweb
  • 30,963
  • 73
  • 183
  • 303
  • and what does `git branch` return? Any branch with a '*' in front of it? Otherwise, you are in a detached HEAD mode (http://stackoverflow.com/a/3965714/6309). – VonC Dec 19 '12 at 15:46
  • And what about the changes you wanted to commit? Are they gone? Use git reflog and check what happened to the commit. You either did git reset, checkout or commit --amend. – Jarosław Jaryszew Dec 19 '12 at 15:52
  • @VonC git branch shows this: [1st line]* (no branch) [2nd line] master. – tirenweb Dec 19 '12 at 16:14
  • @JarosławJaryszew Now im in the penultimate commit (that i can not see either in the log -all list), so the files that i open to edit correspond correctly to that commit. I used git reflog but nothing changed. What else can I do? – tirenweb Dec 19 '12 at 16:17
  • @tirengarfio git reflog shows you history of operations, so you would see there what happened (I still bet commit with --amend option). When you find what is wrong you can: `git reset --soft HEAD@{X+1}` , where X is the operation that broke your history. Then you can commit again. – Jarosław Jaryszew Dec 20 '12 at 11:36

1 Answers1

2
* (no branch) 

Means "detached HEAD"

You could create a branch at that commit:

git checkout -b newBranch

And push that branch.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • but i don't want to create another branch, I would like to work in the master branch. – tirenweb Dec 19 '12 at 16:35
  • @tirengarfio would you like to work in the master branch while still being at the current commit, though? In other words, do you want to reset master branch to your current commit (`git reset master`)? That would mean forcing the next push (as in http://stackoverflow.com/questions/12302171/egit-on-eclipse-how-to-git-push-force/12302449#12302449), forgetting about the other commits on master... – VonC Dec 19 '12 at 18:03