Function: vc-switch-working-tree

vc-switch-working-tree is an autoloaded, interactive and byte-compiled function defined in vc.el.gz.

Signature

(vc-switch-working-tree DIRECTORY)

Documentation

Switch to the version of this file in working tree under DIRECTORY.

Must be called from within an existing VC working tree. When called interactively, prompts for DIRECTORY. This command switches to the file which has the same file name relative to DIRECTORY that this buffer's file has relative to the root of this working tree.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-switch-working-tree (directory)
  "Switch to the version of this file in working tree under DIRECTORY.
Must be called from within an existing VC working tree.
When called interactively, prompts for DIRECTORY.
This command switches to the file which has the same file
name relative to DIRECTORY that this buffer's file has relative
to the root of this working tree."
  (interactive
   (list
    (vc--prompt-other-working-tree (vc-responsible-backend default-directory)
                                   "Other working tree to visit")))
  (let ((project-current-directory-override directory))
    (project-find-matching-buffer)))