G-Eazy's gotta be careful the next time he goes out for a drink in NYC -- he's been ordered to keep away from the guys with whom he allegedly brawled with in a nightclub.
The rapper just left a Big Apple courtroom where he was charged with misdemeanor assault for allegedly punching a guy in the head at the Boom Boom Room at the Standard Hotel.
The judge ordered G-Eazy to steer clear of his alleged victim, plus the man who claims G's entourage smashed a glass bottle over his head in last month's altercation.
G-Eazy was released without bail, and was in no mood to talk when we got him leaving the courthouse.
TMZ broke the story ... G-Eazy was arrested in September after he and his crew allegedly got violent with another group of guys in a bar.
He's scheduled to be back in court next month. Until then, he'll need to tread lightly on the bar scene.