Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I re-init my git repo?

Tags:

git

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?

like image 928
cade galt Avatar asked Nov 25 '15 00:11

cade galt


1 Answers

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).

like image 119
PSkocik Avatar answered Oct 05 '22 15:10

PSkocik