git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}"
git reset --hard "$REFNAME"
echo "$attr" > ".gitattributes"
git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}"
git reset --hard "$REFNAME"
echo "$attr" > ".gitattributes"