Is there any way or any tool or commands to re write the history of master
or some A
branch from some commit number to newly created master
branch of NEW REPOSITORY with master
branch with 0 commits or no history.
In such a way that :
- All the previous commits before commit number "45678" should be re written as single commit in the new repository master branch
- Rewriting the history should begin from commit "45678"
Thanks
(I don't have a suitable sacrificial repository to test this: you've been warned).
I would think
merge --squash
could do this.Merge --squash
from your source branch(See this answer as well.)
Old Content (before question edit)
Just create the new repository as a new remote on your clone of the original repository; and then push to the new repository.
Repeat the last command for each branch you want to push.