Undo-tree style git in terminal

There is a package for Emacs that allows you to use undo-tree instead of just going back and forth with cancellation: http://www.emacswiki.org/emacs/UndoTree

Is there a similar thing for git that allows you to take a look at the commit tree and choose one? Either on the command line or in Emacs?

enter image description here

Note. I'm new to Emacs, and I installed the great Emacs Live - https://github.com/overtone/emacs-live - which seems to include Magit. Emacs Live has a system for adding settings - files go to ~ / .live-packs / cannyboy-pack /. Inside it is the init.el file, which refers to files in another folder - config. So I added (live-load-config-file "magit-custom.el") and added the magit-custom.el file to config with the @event_jr code, and then pointed that to ~ / .live-packs / cannyboy-pack /init.el by adding (live-load-config-file "magit-custom.el")

+4
source share
2 answers

In Emacs, you can see the git commit log tree with magit magit-file-log and open the diff log by pressing RETURN . We can build on top of magit and internal Emacs version control tools go directly to the file.

  • Download the magit installation.
  • Add to your "init.el"

     (defun my-magit-visit-file-at-commit (&optional other-window) "Visit current commit file in another window. This command makes sense from a `magit-file-log' buffer. " (interactive "P") (magit-section-action (item info "visit") ((commit) (let ((filename (expand-file-name (car magit-refresh-args) (concat (magit-git-dir) "../")))) (if (file-readable-p filename) (progn (find-file-noselect filename) (with-current-buffer (find-buffer-visiting filename) (vc-revision-other-window info))) (message "not able to access %s" filename)))))) (eval-after-load "magit.el" '(define-key magit-log-mode-map (kbd "Cc o") 'my-magit-visit-file-at-commit)) 
  • restart emacs

  • open the file whose commit history you are interested in.
  • Mx magit-file-log
  • go to an interesting commit press cc o

change fix missing keyboard layout specification.

+3
source

I think magit is what you are looking for. Here is a good tutorial showing its use.

You should also look at Egg , which is said to have a better user interface.

+1
source

All Articles