Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how tell 'git' to 'forget' ALL prior commits?

Tags:

git

I need to start a new project based on one tiny part of an another project of mine whose repo is at github.

I did a git clone into a new project folder... fine.

I deleted everything I didnt need, got rid of the old migrations etc.... fine.

now it runs fine locally, BUT 'git log' shows ALL the old commits.

I want to tell git "forget ALL the prior commits, this is a new project, so forget everything before now, start from right NOW as the first commit"

I read about git rebase but it's not clear if that's the right command, and if so, how to use it for this very simple purpose.

like image 749
jpw Avatar asked Mar 10 '11 21:03

jpw


1 Answers

Delete the .git folder, run git init and git add

like image 119
orip Avatar answered Oct 05 '22 22:10

orip