Last active
December 9, 2015 21:10
-
-
Save dstollie/0c108159b0760aac1462 to your computer and use it in GitHub Desktop.
Remove all commits to reset a remote GIT repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 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 --set-upstream origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment