git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Indelible actions only

From
Carlos Martín Nieto <cmn@elego.de>
Date
Jun 28, 2011, 22:45 UTC
Message-ID
<20110628224519.GA11733@centaur.lab.cmartin.tk>
In-Reply-To
<BANLkTinUSoB=GGe+qXpPh+WFgRU2S2jnGw@mail.gmail.com>
On Wed, Jun 29, 2011 at 12:18:36AM +0200, Walther Bauer wrote:
> Hello,
> how do I configure a git repository in a way, that no modifications of
> existing history (eg "commit --amend", "branch -d", "rebase") are
> allowed?
From the git-config man page
       receive.denyNonFastForwards
           If set to true, git-receive-pack will deny a ref update which is
           not a fast-forward. Use this to prevent such an update via a push,
           even if that push is forced. This configuration variable is set
           when initializing a shared repository.

so set that variable to true. This has to be in the repository you use to synchronize. IIRC it can't be avoided locally (but that's not a problem, because you shouldn't be working directly on the public repo anyway).

Cheers,
   cmn
-- 
Carlos Martín Nieto | http://cmartin.tk

"¿Cómo voy a decir bobadas si soy mudo?" -- CACHAI
Previous: Walther Bauer
Message 2 of 2 in “Indelible actions only”
  1. Walther BauerJun 28, 2011
  2. Carlos Martín NietoJun 28, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.