G-Eazy just struck a deal in the NYC case where he's accused of brawling in a bar ... and he's going to avoid time behind bars.
The rapper appeared in a courtroom in New York City Monday, pleading guilty to disorderly conduct -- lower than his original charge of misdemeanor assault -- and was assigned to a diversion program ... according to the Manhattan District Attorney's Office.
We're told G-Eazy must complete 3 Manhattan Justice Opportunities sessions ... which are an alternative to incarceration and basically involve meetings with social workers and case managers designed to put people back on a positive path.
TMZ broke the story ... G-Eazy was arrested back in September after he and his crew were accused of getting violent with another group of guys at the Boom Boom Room at the Standard Hotel.
G-Eazy was eventually charged with misdemeanor assault, and ordered to steer clear of the alleged victims. We're told the protective order will remain in place.