How to reset a remote git repository to remove all commits

Delete the .git directory locally and recreate the git repostory:
$ cd (project-directory)
$ git init
$ (add some files)
$ git add .
$ git commit -m 'Initial commit'
Push to remote server, overwriting. Remember you're going to mess everyone else up doing this so you better be the only client.
$ git remote add origin <url>
$ git push --force --set-upstream origin master

Comentarios