tags:

views:

38

answers:

1

Newbie with git here. I have a Remote Repository, cloned on my PC. It's on the master branch and git push/pull to the remote works.

Now, I want to completely start over, but keep the repository. I would like to move the current master branch into a new branch and clone that separately (so that I have it and can even still work on it) and make a new branch the master branch.

In SVN, I would copy /trunk to /branches/old (and check that out) and delete everything in /trunk. What would be the git equivalent of this?

+2  A: 

First, create a new branch that remembers your current position.

git checkout -b old

Go back to your old master branch.

git checkout master

Do whatever you please, the old branch will not be changed.

git rm -r *
git commit -m "Throw away everything."
Bombe
Okay, I needed to "git push origin old" to push the "old" branch to the "origin" remote. Then, git clone -b old to clone the old branch again. Thanks :)
Michael Stum