← back to the blog
fousa blog
15
JAN
Reinitialize your Git repo
This came in very handy when you want to reinitialize your Git repository from scratch without losing the current folder structure.
WHY?
I started developing an iPhone application and for API testing purposes I manually added my username and password in the code. And by accident I committed the change...
So now my password was in the Git history.
HOW?
Just remove the .git file from the top folder.
rm -rf .gitAnd then initialize the repository.
git initAnd that's it... Very easy! Thank you Julien for helping me!
Send me some feedback!
Another way to do this is described on the guides of Github: http://i5.be/al4. This is maybe a more solid approach! This way you don't love all the versions of the other files in your project.
written by Jelle vandebeeck → 8 months ago