|
From: | Gregory Heytings |
Subject: | Re: Amending commits |
Date: | Mon, 26 Sep 2022 07:53:30 +0000 |
Yes, I said "by default": force pushes are disabled in the default settings of Git repositories, unless they have been enabled you cannot do that.Not sure if this default has changed, but last time I checked the default was to allow such force pushes (`emacs.git` and `elpa.git` have explicitly changed this setting to disallow them). You just need to specify the `--force` option when you push.
These repositories have been created with git init --shared, which automatically sets denyNonFastforwards to true. This has been the default since Git 1.5 in 2007.
For those repositories like `emacs.git`, `--force` doesn't override the server's wish, but you can still force push by first deleting the branch and then pushing the new history.
With branches, yes, but not with master, unless denyDeleteCurrent has been set to warn or ignore. And this is not always possible, even with branches: all deletions can be disallowed by setting receive.denyDeletes to true.
[Prev in Thread] | Current Thread | [Next in Thread] |