A court heard Ryan York pointed the air pistol at Sarah McLeod's feet and ordered her to "dance, dance, dance".
He then shot her in the leg and demanded that she cover up the attack when she went to hospital.
A sheriff told York he had treated Miss McLeod "like dirt" during the "despicable" incident in December 2014.
Depute fiscal Vicki Bell told Dundee Sheriff Court that staff at Ninewells Hospital had reported the injury to police as they believed it had been caused by a firearm.
Miss Bell said: "She provided a statement attempting to cover up the incident by saying she had been shot in the leg at a party and did not remember where she had been or who was there.
"The couple separated in October 2015 and after speaking to friends and family Miss McLeod decided to go to police."
The court was told that prior to the shooting, Miss McLeod and York had an argument after she refused to get him a glass of water.
Miss Bell said: "She saw him lean over the side of the bed and present an object which she knew to be a handgun at her.
"She assumed it was a replica or fake gun.
"However, he pointed the gun directly at her and shouted "get up and get water, you will go get it now".
"She turned and walked towards the door and heard a loud pinging noise.
"She looked down at her leg and observed heavy blood flow coming from her lower calf area."
York, 25, admitted a charge of assault to injury.
Sheriff Alastair Brown ordered York to be monitored in the community for a year after his release.
He was also banned from contacting Miss McLeod for five years.
Sheriff Brown said: "You did not simply assault her - you treated her like dirt, you treated her like your personal servant.
"You told the social worker that you pointed the gun at her and told her to 'dance, dance, dance'.
"That is despicable."
A Dundee man who shot his girlfriend when she refused to get him a glass of water in the middle of the night has been jailed for 32 months.