How to rebase all the commits from the beginning

后端 未结 5 861
北荒
北荒 2021-01-31 07:12

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 real

5条回答
  •  青春惊慌失措
    2021-01-31 07:56

    If you'd like to reduce all your history to a single "Initial import" commit, simply remove .git directory and create a new local repository (keeping a backup of the old one). git init . && git add . && git commit -m "Initial import".

    Such new repository won't have a common ancestor with the one you've pushed to GitHub, so you'll have to git push --force your newly created repository.

提交回复
热议问题