Variable: vc-allow-rewriting-published-history
vc-allow-rewriting-published-history is a customizable variable
defined in vc.el.gz.
Value
nil
Documentation
When non-nil, permit VCS operations that may rewrite published history.
Many VCS commands can change your copy of published change history without warning. If this occurs, you won't be able to pull and push in the ordinary way until you take special action. For example, for Git, see "Recovering from Upstream Rebase" in the Man page git-rebase(1).
Normally, Emacs refuses to run VCS commands that it thinks will rewrite
published history. If you customize this variable to ask, Emacs will
instead prompt you to confirm that you really want to perform the
rewrite. Any other non-nil value means to proceed with no prompting.
We recommend customizing this variable to ask or leaving it nil,
because if published history is rewritten unexpectedly it can be fairly
time-consuming to recover. Only customize this variable to a non-nil
value other than ask if you have a strong grasp of the VCS in use.
This variable was added, or its default value changed, in Emacs 31.1.
Probably introduced at or before Emacs version 31.1.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;; The default is nil because only a VC user who also possesses a lot of
;; knowledge specific to the VCS in use can know when it is okay to
;; rewrite history, and we can't convey to a user who is relatively
;; naïve regarding the VCS in use the potential risks in only the space
;; of a minibuffer yes/no prompt.
;;
;; See `vc-git--assert-allowed-rewrite' for an example of how to use
;; this variable in VCS backend code.
(defcustom vc-allow-rewriting-published-history nil
"When non-nil, permit VCS operations that may rewrite published history.
Many VCS commands can change your copy of published change history
without warning. If this occurs, you won't be able to pull and push in
the ordinary way until you take special action. For example, for Git,
see \"Recovering from Upstream Rebase\" in the Man page git-rebase(1).
Normally, Emacs refuses to run VCS commands that it thinks will rewrite
published history. If you customize this variable to `ask', Emacs will
instead prompt you to confirm that you really want to perform the
rewrite. Any other non-nil value means to proceed with no prompting.
We recommend customizing this variable to `ask' or leaving it nil,
because if published history is rewritten unexpectedly it can be fairly
time-consuming to recover. Only customize this variable to a non-nil
value other than `ask' if you have a strong grasp of the VCS in use."
:type '(choice (const :tag "Don't allow" nil)
(const :tag "Prompt to allow" ask)
(const :tag "Allow without prompting" t))
:version "31.1")