Function: vc-create-tag
vc-create-tag is an autoloaded, interactive and byte-compiled function
defined in vc.el.gz.
Signature
(vc-create-tag DIR NAME BRANCHP)
Documentation
Descending recursively from DIR, make a tag called NAME.
For each registered file, the working revision becomes part of
the configuration identified by the tag.
If BRANCHP is non-nil (interactively, the prefix argument), the
tag NAME is a new branch, and the files are checked out and
updated to reflect their revisions on that branch.
In interactive use, DIR is default-directory for repository-granular
VCSes (all the modern decentralized VCSes belong to this group),
otherwise the command will prompt for DIR.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-create-tag (dir name branchp)
"Descending recursively from DIR, make a tag called NAME.
For each registered file, the working revision becomes part of
the configuration identified by the tag.
If BRANCHP is non-nil (interactively, the prefix argument), the
tag NAME is a new branch, and the files are checked out and
updated to reflect their revisions on that branch.
In interactive use, DIR is `default-directory' for repository-granular
VCSes (all the modern decentralized VCSes belong to this group),
otherwise the command will prompt for DIR."
(interactive
(let ((granularity
(vc-call-backend (vc-responsible-backend default-directory)
'revision-granularity)))
(list
(if (eq granularity 'repository)
;; For VC's that do not work at file level, it's pointless
;; to ask for a directory, branches are created at repository level.
default-directory
(read-directory-name "Directory: " default-directory default-directory t))
(read-string (if current-prefix-arg "New branch name: " "New tag name: ")
nil 'vc-revision-history)
current-prefix-arg)))
(message "Making %s... " (if branchp "branch" "tag"))
(when (file-directory-p dir) (setq dir (file-name-as-directory dir)))
(vc-call-backend (vc-responsible-backend dir)
'create-tag dir name branchp)
(vc-resynch-buffer dir t t t)
(message "Making %s... done" (if branchp "branch" "tag")))