Git Timemachine

Easily navigate backwards and forwards throught the change history of a file, seeing changes in the file as you move between commits.

Hint Timemachine seems to work best when you have all the text visible in a buffer or you roughly know where the changes are in the file as you move between commits.

Using Timemachine

You can use Git Timemachine with any buffer that holds a file in Git version control. When you enable timemachine in the buffer, editing is disabled, so you can use the simple keybindings in this mode (detailed below)

Visit a git-controlled file and run the command M-x git-timemachine (or bind it to a keybinding such as C-o g t t). Alternatively, toggle the time machine you can use M-x git-timemachine-toggle.

Use the following keys to navigate historic version of the file

  • p Visit previous historic version
  • n Visit next historic version
  • w Copy the abbreviated hash of the current historic version
  • W Copy the full hash of the current historic version
  • g Goto nth revision
  • q Exit the time machine.

Customize

Fixme work in progress - add how to set these configuration options in Spacemacs

Set git-timemachine-abbreviation-length (default 12) to your preferred length for abbreviated commit hashes.

Set git-timemachine-show-minibuffer-details (default t) to control whether details of the commit are shown in the minibuffer.

Also M-x customize [git-timemachine].

results matching ""

    No results matching ""