GitHub fork a repo from previous commit

You can only fork the current repository.

You can reset the forked repository’s master branch to an earlier commit though, making it look like as if you had forked it at that point.

See: How can I rollback a github repository to a specific commit?

If you reset every branch, it effectively resets your repository to an earlier state of the original repository (with exception of branch-independent data, like configuration, hooks etc which are not reset). Since it’s possible that not all branches contain the commit from the master branch, you might need to look up commits by date for each branch, to reset them to the last commit before the commit from which you want to fork.

Leave a Comment