Skip to content

Instantly share code, notes, and snippets.

@sambos
Created October 27, 2017 05:10
Show Gist options
  • Save sambos/6f9e8bbb60675aa1f5a2ee2fd147e36e to your computer and use it in GitHub Desktop.
Save sambos/6f9e8bbb60675aa1f5a2ee2fd147e36e to your computer and use it in GitHub Desktop.
removing history from git/github for sensitive data that is accidentally checked in
cd your to your cloned project
-- make sure you pull all the code from the repo before you lose it
git pull origin master
rm -rf .git
-- recreate from the contents
git init
git add .
git commit -m"initial"
git remote add origin your-git-url.git
git push -u --force origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment