How to reset a remote and local GIT repository to remove all revisions, and start fresh with the current Head as initial commit.
+1
A:
First, follow the instructions in this question to squash everything to a single commit. Then make a forced push to the remote:
$ git push origin +master
And optionally delete all other branches both locally and remotely:
$ git push origin :<branch>
$ git branch -d <branch>
Martinho Fernandes
2010-01-05 13:18:14
+3
A:
Completely reset?
1) Delete the .git directory locally. 2) Recreate the git repostory
$ cd (project-directory)
$ git init
$ (add some files)
$ git add .
$ git commit -m 'Initial commit'
3) Push to remote server, overwriting. Remember you're going to mess everyone else up doing this... you better be the only client.
> git remote add origin <url>
> git push -force
Computer Linguist
2010-01-05 13:23:55
+1 Was my first thought too. You have to backup and restore any local configs you have though.
Martinho Fernandes
2010-01-05 13:27:48
Still in the remote repo at GitHub, in the messages I see previous messages.
Priyank Bolia
2010-01-05 13:44:40
but the commits are gone, and repository is reset. Can we remove those previous messages also in front of the filenames.
Priyank Bolia
2010-01-05 13:45:31
Remove the remote repository directly on GitHub and recreate it there.
Bombe
2010-01-05 14:14:58