6
How do I fork a project at a given point?
(lemmy.world)
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Resources
Rules
Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.
It may depend where the project is and what you want to bring with you.
If you're asking solely about the Git repository: you need to find exactly which commit is the latest one you want to bring, and specify that commit identifier (the hash of that commit) as the “starting point” when you create a new branch.
https://git-scm.com/docs/git-branch
So, clone the repository locally however you need to do that. Then, in your local repository, modify what the branches point to:
e.g. If you determined the latest commit you want to bring, has commit identifier “deadbeefbad1dea”, you can create the branch named “before-the-slop”:
Now the new branch “before-the-slop” has all the commits up to that, and no further. That's what you'll base your fork on.
Then rename the old “main” or whatever branch, to something like “sloppified-project-main” that gets it out of the way; rename your “before-the-slop” branch to “main”; and set “main” as the default branch in your repository.
Some time later, when you've confirmed your repository is how you like it, delete the “sloppified-project-main” branch:
and breathe easy.