The master branch of a new project's git repo contains only prototype/spike code. I'm about to re-start the coding from scratch, now that I have the basic ideas understood.
I want the master branch to be clear of all the prototype code. Ideally the prototype code needs to be moved into a branch so I can still get to it later.
Is it possible to reset master back to before the first commit? What are the git commands to do this?
If you're really going to start from scratch, just create a completely new repository. It's possible to have two branches without any common ancestor, but it's not really that useful.
This is how you create a new branch not sharing any history with your other branches: How to create a new empty branch for a new project.
Before following these instructions, just rename your existing master
to prototype
using git branch -m master prototype
. Then, when following the linked instructions, use master
instead of newbranch
.
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