A man allegedly stabbed a stranger who failed to give him a cigarette, and was then traced back to his home by a police sniffer dog, a court has heard.

Police say the man, Jonathan Peterson of Long Gully in Bendigo, left his home on Saturday night, after his partner asked him to get cigarettes.

Accused man Jonathan Peterson arrives at Bendigo Magistrates' Court. Credit:Darren Howe

He was allegedly waiting near a path when another man walked by, who was playing Pokemon Go on his phone, about 11.30pm.

Mr Peterson allegedly asked the stranger for a cigarette and $5, before pulling out a small knife and saying, "Give us what you’ve got".