Is there a way to delete a commit without deleting the project on github ?
2 answers
Is there a way to delete a commit without deleting the project on github?
An absolutely exact answer in the form - no.
and the “correct” answer will be:
- delete this commit in your local copy of the repository .
Send this change to shared storage on github by adding the
-f(--force) option:$ git push -f- notify other users of this shared repository, so that they also delete this commit in their local copies (if they "managed" to receive it).
- Be prepared for the fact that:
- from the local repositories of other users of this shared repository, this commit, if it has already been received by them, will not go anywhere (without their active intervention).
- this commit will again appear in the shared storage history you have copied, if at least one of the other users of this shared storage “managed” to receive this commit, and without taking actions to remove it from its local storage, execute the
pushcommand.
|
Here githab says how to do it
|