4

I was just called upon to fix a bug in my application. I stashed up my current work and checked out my newest version tag. I promptly noticed that was a mistake, as the Git message told me that my commits wouldn't be saved, so I checked out master instead. But before I did that, I had already popped my stash, the re-stashed:

$ git checkout v1.6.0
$ git stash pop
$ # Oops, I'm not supposed to be here
$ git stash
$ git checkout master
$ git stash pop

Then I fixed the bug, committed and created a new tag for it (v1.6.0-hotfix-1). Now my repository looks like it has been bombed. It used to be so clean, with two branches side by side with a merge and a tag now and then. Now it looks like this:

Screenshot

Suddenly all my tags on the master branch is squished together instead of far apart, and there are "index on" and "WIP on" commits spread around, probably due to the stashing. I'm going with the assumption that those "commits" are the reason for the mess, so I'd like to remove them.

But how do I do that? Could anybody explain what is going on?


Edit: Screenshot after restarting gitk:

Screenshot

All the "index on" and "WIP on" points are gone, but my repo still looks bombed. How can that be?

JB.
  • 40,344
  • 12
  • 79
  • 106
Hubro
  • 56,214
  • 69
  • 228
  • 381
  • 2
    Have you tried turning it (gitk) off and on again? Most of your remaining commits aren't referenecd anymore, so they're liable to disappear anytime. There's probably a softer option to refresh that, but not off the top of my head. – JB. Nov 13 '13 at 10:15
  • I refreshed repeatedly, but they disappeared when I restarted gitk. Why, then, has many of my version tags risen to the top when they used to be spread far apart? – Hubro Nov 13 '13 at 10:21
  • AFAIK, the only ordering gitk guarantees is that commits that are known ascendants have to be below. Apart from that, I think you can influence its initial ordering by having a different branch checked out at startup time, but that's about it. – JB. Nov 13 '13 at 10:26
  • "Why, then, has many of my version tags risen to the top when they used to be spread far apart?" -- The commits are shown in topographical order (correct relationship between the commits, but not between the commit *dates*). You can show the chronological (which will spread your tags back out) by editing the view and selecting "Strictly Sort by Date". This will be less 'pretty', though. – simont Nov 13 '13 at 11:18
  • @simont: Wow, that actually looks a lot better in my case! Thanks for the tip – Hubro Nov 13 '13 at 11:49
  • 3
    You can use CTRL-F5 to force a full refresh in gitk instead of closing it. F5 will keep previously displayed commits (which comes in very handy if you screw up as you still can access commit-ids of accidentially removed commits this way). – centic Nov 14 '13 at 05:30
  • If a solution was found it should be moved to an answer and marked as such. – Catskul Jun 16 '14 at 19:52

1 Answers1

3

You use the 'Reload' gesture, that in some mileages is mapped by default to Ctrl-F5 and in some others to Shift-F5. Often found in the GUI menus under the File menu.

1737973
  • 159
  • 18
  • 42