4 ms·
> so it’s good practice to create an empty commit as your repository root While I'm aware of issues with rebasing the root commit, I've never heard this advice
by michaelmior 10y ago
> so it’s good practice to create an empty commit as your repository root
While I'm aware of issues with rebasing the root commit, I've never heard this advice before and it seems unnecessary.
- samstokes 10y agoRebasing the root commit has been possible for a while using `git rebase --root`. http://stackoverflow.com/questions/30277149/how-to-use-interactive-rebase-on-the-first-root-commit-of-a-branch http://stackoverflow.com/questions/30277149/how-to-use-inter... goes into more detail.
- oconnor663 10y agoThere's also the `--root` flag for rebase, which solves this problem without needing the dummy commit. I think this section of the article is out of date.
- stormbrew 10y agoI actually like to make an empty root commit just as a place to describe what I intend to do with a repo. I'm uncomfortable doing it as a README commit because that lends it an undue amount of permanence once work begins. Occasionally on repos that are really just for me I even do this as a 'root' commit for work branches, but the way rebase rolls over empty commits makes that kind of problematic in the long run.
- opk 10y agoIt also helps if you want to do an octopus merge of branches that otherwise have no common ancestor. If it comes to it, you can use git replace to provide a false parent for the root commit.