Matt Barnes ain't going to jail for his role in a Dec. nightclub brawl in NYC -- but he will spend some time helping out the community per a plea deal in the case ... TMZ Sports has learned.
The Golden State Warriors star appeared in court Tuesday morning where he formally pled guilty to disorderly conduct and in exchange he was sentenced to 10 days of community service.
We broke the story ... Barnes and DeMarcus Cousins were in the middle of a violent altercation inside Avenue nightclub on Dec. 5 after he allegedly "butt bumped" a woman near his VIP booth.
The woman claimed Barnes choked her. Barnes claimed he was merely defending himself.
The NBA star was eventually arrested and charged with misdemeanor assault -- but he cut a deal with prosecutors to get a lighter sentence.
Barnes is due back in court in August for an update on the community service.
Of course, Barnes is also being sued by the victims in civil court -- they want Barnes and DeMarcus to pay up big-time for injuries they claim the players caused.