When porcupines mate, the female relaxes her quills and folds them flat against her body, lifts her quilled tail and arches it over her back, and raises her rear. This enables the male to mount her without risking injury from her quills.
According to an old joke, the answer to the question "How do porcupines mate?" is "very carefully." This is because a porcupine's body is almost entirely covered with about 25,000 sharp quills, which it uses for self-defense. Before porcupines can mate, the male must perform an elaborate courtship ritual to entice the female. The ritual usually includes fighting off rival males and spraying the female with urine.