I have been lazy and putting all my commits into the master branch. What I want to do now is to structure my git repositories like this guide says: http://nvie.com/posts/a-successful-git-branching-model/
What I want to do now is to move all my commits in master to a new branch called master-cleanup. Then I will want to merge master-cleanup with master so that I only have one commit in master. The reason for why I want to do this is that all the commits in master takes up a lot of space and if I move all commits to a cleanup branch I guess that I can on my local machine remove that branch and only have it located on the server. This way when I checkout my master branch I will only download the latest commit and not all the history right?
I tried to do this with first creating the new branch and then reset the master to the first commit. After that I merge with master-cleanup with no-ff:
git branch master-cleanup
git reset --hard 4f8d90cc225288bf889090f80103cfa0887a4742
git merge --no-ff master-cleanup
I thought that this would move all my commits to the new master-cleanup branch but when I perform the merge I also import all the commits. I thought that the --no-ff would prevent this and force the merge to be a new single commit to the master? Now I git the entire commit log plus the new merge commit...
Any ideas on how to solve what I want to do?