Skip to content

Instantly share code, notes, and snippets.

@akihiroy
Last active September 28, 2020 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save akihiroy/1fc8ba286e6e84f6d07659b93dcd23b7 to your computer and use it in GitHub Desktop.
Save akihiroy/1fc8ba286e6e84f6d07659b93dcd23b7 to your computer and use it in GitHub Desktop.
git example
# Clean up backup and loose objects.
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
# 全ての履歴に .gitignore / .gitattributes を追加する
git filter-branch --index-filter "cp -t ./ ../.gitignore ../.gitattributes && git add .gitignore .gitattributes" -f -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment