So I'm migrating from svn (code.google.com) to git(github).
I've imported my project from the svn repo, and it imported all the commit history along way. I'm not really proud of those comments as it was one of my first project, not really serious.
I'd like to rebase everything into a single 'initial import' commit.
I've pulled everything on my computer and I'm trying to do that. But all I found was: git rebase -i master
but it only rebases new modifications and commits.
How can I clean my github repository from all history with a rebase?
To rebase, make sure you have all the commits you want in the rebase in your master branch. Check out the branch you want to rebase and type git rebase master (where master is the branch you want to rebase on).
Squashing by Interactive Rebase. Git's interactive rebase will list all relevant commits in the default editor. In this case, those are the commits we want to squash. Then we can control each commit and commit message as we want and save the change in the editor.
What is git rebase? Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow.
Interactive Rebase also allows you to reorder commits. Simply drag and drop a commit between two existing commits to reorder history.
git rebase -i --root
will start an interactive rebase of all commits from the beginning.
From there, you can squash all commits into one and/or perform other edits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With