Answer the question
In order to leave comments, you need to log in
How to remove all commits from a GIT repository except for the last one?
There is an old git repository with hundreds of commits. How to make the entire history of the master branch reduced to only the last commit? It should turn out as if we created a new repository, where we uploaded the files and that's it. The history of changes and all deleted/modified files are no longer needed.
Answer the question
In order to leave comments, you need to log in
This can be done via git rebase --root -i , an editor will open in which you need to specify pick for the first commit, and squash for the rest .
This is contrary to the raison d'être of the git.
Need a new turnip - create a new turnip and transfer the files.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question