0

In gitk --branches or gitk BRANCH1 BRANCH2 I can refresh the view with F5, but after rebasing or amending commits, the view retains the commits that are no longer being pointed to by any branches.

'gitk master origin/master'   Gitk after                       After restarting Gitk
                                  'git rebase origin/master'
                              and pressing F5 in gitk.

  I (HEAD,master)               I' (HEAD,master)               I' (HEAD,master)
  H                             H'                             H'
  G                             G'                             G'
  F                             F'                             F'
  E                             E'                             E'
  D                             D'                             D'
  | C (origin/master)           C  (origin/master)             C  (origin/master)
  | B                           B                              B
  |/                            | I                            A
  A                             | H                            :
  :                             | G                            :
  :                             | F
                                | E
                                | D
                                |/
                                A
                                :
                                :

Now, I know that I can remove the D..I commits by restarting gitk or by resetting the view from View > Command line by reconfiguring the view through View > Edit. But is there a more convenient way to achieve it?

kdb
  • 4,098
  • 26
  • 49
  • 2
    My gitk is broken at the moment, but I thought Ctrl+F5 refreshed everything, including removing commits like the ones you describe – Collin Mar 26 '20 at 14:18
  • 1
    Ctrl+F5 is a shortcut for File->Reload – EncryptedWatermelon Mar 26 '20 at 15:09
  • The problem is that `gitk` ran a `git rev-list` earlier and nabbed, into its tcl arrays, the hash IDs of the original commits, which all still exist. You'll need to convince it to run a new rev-list so that it doesn't have the old hash IDs any more. I don't use gitk much so I'm not sure offhand what triggers that. – torek Mar 26 '20 at 21:01

1 Answers1

2

File -> Reload (Shift-F5)

This will rebuild the commit list. It's slower than Refresh (F5) but will remove the old commit.

stefandtw
  • 468
  • 6
  • 5