How can I re-init my git repo?

2020-07-03 07:24发布

问题:

I've been doing some beginning work on a repo and I don't need the history.

I want to start from ground zero w/ no history?

Can I simply delete the .git folder and run git init again.

But how will this effect my remote repos?

回答1:

cd "$PWD/`git rev-parse --show-cdup`" #go to the project's root
rm -rf .git

And then:

git init .
#...

As for your remote repos, you'll need to git push --force into them (or push to a new, completely separate branch).



标签: git