It's a bad practice, because git makes keys practically irrevocable. It's not enough to rotate encryption keys, because the old ciphertexts are in the git history; you have to rotate the underlying secrets as well (people don't do this and shouldn't have to).
Don't store encrypted secrets in git if you can avoid it.
Don't store encrypted secrets in git if you can avoid it.