Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

15
  • 79
    but you are loosing branches with this method Commented Jan 24, 2012 at 20:40
  • 215
    Git has evolved since this answer was given. No, there is a simpler and better way: git rebase -i --root. See: stackoverflow.com/a/9254257/109618
    – David J.
    Commented Jul 12, 2013 at 5:24
  • 11
    This might work for some cases, but it is essentially not the answer to the question. With this recipe, you loose all your config and all other branches too.
    – iwein
    Commented Nov 16, 2013 at 19:58
  • 18
    This is a horrible solution that's needlessly destructive. Please don't use it. Commented Nov 24, 2015 at 15:05
  • 11
    also will break submodules. -1
    – Krum
    Commented Apr 27, 2016 at 12:31