Skip to content

Instantly share code, notes, and snippets.

@dphoebus
Forked from akihiroy/git-example.sh
Created September 28, 2020 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dphoebus/2664b2ba554a9eb460b36d4035b217fb to your computer and use it in GitHub Desktop.
Save dphoebus/2664b2ba554a9eb460b36d4035b217fb 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