Skip to content

Instantly share code, notes, and snippets.

@z2015
Created May 2, 2016 02:36
Show Gist options
  • Select an option

  • Save z2015/69a6ad0b500574a285ada3c83cfbbf32 to your computer and use it in GitHub Desktop.

Select an option

Save z2015/69a6ad0b500574a285ada3c83cfbbf32 to your computer and use it in GitHub Desktop.
移除之前github上不小心提交的敏感信息
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch Rakefile' \
--prune-empty --tag-name-filter cat -- --all
Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (266/266)
Ref 'refs/heads/master' was rewritten
echo "Rakefile" >> .gitignore
git add .gitignore
git commit -m "Add Rakefile to .gitignore"
git push origin --force --all
//https://help.github.com/articles/remove-sensitive-data/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment