This repository has been archived by the owner on Nov 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Discourage (prevent?) use of push --force #94
Comments
salcode
added a commit
that referenced
this issue
Dec 26, 2018
This script should be executible and aliased to git. If someone tries to use `git push --force` it prevents them, otherwise it calls the real copy of git with the same parameters. See #94
salcode
added a commit
that referenced
this issue
Dec 26, 2018
By aliasing "git" to this script, we can add our own checks before git does anything. e.g. We can check if the user is trying to use git push --force and present them with an error message and explanation on why it is a bad idea. Once our checks are based, this script calls the real git program and passes in the same parameters. See #94
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
By aliasing "git" to this script, we can add our own checks before git does anything. e.g. We can check if the user is trying to use git push --force and present them with an error message and explanation on why it is a bad idea. Once our checks are based, this script calls the real git program and passes in the same parameters. See #94
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
By aliasing "git" to this script, we can add our own checks before git does anything. e.g. We can check if the user is trying to use git push --force and present them with an error message and explanation on why it is a bad idea. Once our checks are based, this script calls the real git program and passes in the same parameters. See #94
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
salcode
added a commit
that referenced
this issue
Dec 26, 2018
I'm testing out some code to add this I'll use it in my everyday use for a bit and if I'm happy with it, I'll create a PR to merge this functionality. |
salcode
added a commit
that referenced
this issue
Jan 11, 2019
By aliasing "git" to this script, we can add our own checks before git does anything. e.g. We can check if the user is trying to use git push --force and present them with an error message and explanation on why it is a bad idea. Once our checks are based, this script calls the real git program and passes in the same parameters. See #94
salcode
added a commit
that referenced
this issue
Jan 11, 2019
salcode
added a commit
that referenced
this issue
Jan 11, 2019
salcode
added a commit
that referenced
this issue
Jan 11, 2019
salcode
added a commit
that referenced
this issue
Jan 15, 2019
By aliasing "git" to this script, we can add our own checks before git does anything. e.g. We can check if the user is trying to use git push --force and present them with an error message and explanation on why it is a bad idea. Once our checks are based, this script calls the real git program and passes in the same parameters. See #94
salcode
added a commit
that referenced
this issue
Jan 15, 2019
salcode
added a commit
that referenced
this issue
Jan 15, 2019
salcode
added a commit
that referenced
this issue
Jan 15, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
While we have added aliases to make it easier to use
push --force-with-lease
instead ofpush --force
(see both #10 and #71), I would like go so far as to preventpush --force
.I've not determined a way to do this with a git alias (since I don't see a way to map a current command, i.e.
git push
, to something else).I think the best route may be to create a bash script that runs in place of
git
. The script would listen forpush --force
and intervene in that situation, otherwise it would pass along all commands togit
.The text was updated successfully, but these errors were encountered: