1

I'm currently starting a new project based on a previous one . I forked it and now I'm cleaning up the parts I don't need.

The issue is that a forked project keeps the commit history and bring the starting date of the base repo.

I would like the repo to look like it was a brand new project.

Is it possible to do so ?

JSharles
  • 565
  • 1
  • 5
  • 16
  • 3
    Yes. Just delete the `.git` folder and start a new repo from the current working tree with `git init`. – Romain Valeri Jun 09 '22 at 07:27
  • 1
    @RomainValeri Deleting the `.git` removes carefully crafted `.git/config` and clever tricks in `.git/hooks`. Deleting the `.git` seldom is the answer. See the duplicate for more interesting approaches. – phd Jun 09 '22 at 15:34
  • @phd I missed that question, I admit it's a way more comprehensive approach. – Romain Valeri Jun 09 '22 at 15:48

2 Answers2

2

Yes: You can simply check the repo out locally, remove the (usually hidden) .git folder from like so :

rm -rf .git

and create a new repo.

Alternatively, you can rebase the entire history into one giant squash commit, but that'll be more work if you really are just interested in a single fork-is-base commit.

L3viathan
  • 26,748
  • 2
  • 58
  • 81
1

You can remove the .git folder and reinit the repo

xiaoD
  • 9
  • 3