for REF in $(git for-each-ref --format='%(refname)'); do git update-ref "$REF" "$TREE" done