2

Something really strange here I cannot figure out.

Last night I committed some files.

About lunch time today I realised that the files has "lost" all the changes I'd committed yesterday.

I went back through the git log results and sure enough the commit was there. I checked the contents by doing a git diff and the commit contains the changes. However ....

If I do a git log I can see the commit in the list of all commits. If I do a commit log on one of the files in the commit, I see every commit except the one from last night. If I do a git show to display the files in the commit the specific file is there. Sooooo

git log - shows the commit git show - shows the files in the commit git log file - list every commit but the one I'm interested in !!

I also cannot figure out how to tell what killed the committed changes.

Anyone got any clues? I like git, but it's a real pain in the rear to figure out sometimes.

drekka
  • 20,957
  • 14
  • 79
  • 135

2 Answers2

1

Try to do a git checkout on the directory and see if that has any effect. If that doesn't update them, delete them and then do a git checkout on the files.

Jesus Ramos
  • 22,940
  • 10
  • 58
  • 88
  • I gave up and cut and pasted the mods from the diff. Probably there is an easier way to do it, but I didn't have time to ind it :-) – drekka Sep 29 '11 at 07:51
  • The way I mentioned above is the easiest way while keeping everything consistent as git checkout gets a clean copy of the file in question from the repo. – Jesus Ramos Sep 29 '11 at 07:55
1

Make sure you haven't committed those files while being on a detached head.
(git branch --all would not mention any current branch)

detached head

The commit would be there, but not accessible from a branch.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Nope, we are working on master only. The really weird thing is that of the 3 files in the commit, one files changes did stick and the other two's didn't. – drekka Sep 29 '11 at 07:52