In S2E10 "Valar Morghulis" of Game of Thrones, Qhorin Halfhand started provoking and attacking Jon Snow. Why was this?
My only thought was that it was to make the Wildlings trust Jon but I don't see how it achieves that!
When Halfhand and Jon Snow are the lone survivors of their patrol and are captured by the wildlings, Halfhand orders Jon Snow to defect. The scene which you are questioning is where the actual deed transpires.
Halfhand knows that once they reach the Wildling's camp, both of them will be killed or worse, first tortured and then killed. He can also sense that their only chance is if they can convince the Wildling's that Jon Snow is no more a Crow . But for that they needed a substantial hook. Thus, Qhorin Halfhand engages Jon Snow in a mock fight which leads to Jon Snow claiming Halfhand's life (which was what Halfhand intended to happen).
Due to this act of his, Jon Snow is able to convince the Wildlings that he never really wanted to be a Night's Watch ranger and despised their authority.
KeyBrd Basher's answer is correct in relation to the tv-shows.
However, I will add some further clarification from the books:
[A Clash of Kings spoilers]