4 ms·
>> Zero a branch to do something radically different There's another way to do this: git checkout --orphan new-branch
by FuzzyDunlop 14y ago
>> Zero a branch to do something radically different
There's another way to do this:
git checkout --orphan new-branch
- 0x0 14y agoLast time I tried this, I was getting a lot of hassle when switching between branches that have no common ancestor; .gitignored files disappearing completely (very annoying when you keep a local config file around etc.), files left over and "not staged for commit" instead of being removed, etc. Maybe the "empty root commit" trick would help, I haven't tested that they.
- X-Istence 14y agoYou are going to have those issues anyway. Since there is no common ancestor you will have to commit a .gitignore from scratch to that new branch. Files left over is another common issue, if they are not committed then when you switch branches they are going to stick around, just like with any other branch switch...
- manojlds 14y agohttp://stackoverflow.com/questions/5689960/how-do-i-create-a-commit-without-a-parent-in-git/5690048#5690048 http://stackoverflow.com/questions/5689960/how-do-i-create-a...