Joselu Mato scored a goal in each half to move Madrid two points clear of Girona at the top of the standings.
It was the sixth straight league victory for Madrid, who are unbeaten in 25 matches in all competitions, since a 3-1 league loss at Atletico Madrid in September.
Madrid are 10 points ahead of both Atletico and defending champions Barcelona.
Atletico defeated Rayo Vallecano 2-1 on Wednesday, while Barcelona defeated Osasuna 1-0. Both matches were postponed because of the Spanish Super Cup that was won by Madrid last month in Saudi Arabia.
Madrid beat Atletico in the Super Cup semi-final before defeating Barcelona in the final. Atletico later eliminated Madrid in the round of 16 of the Copa del Rey.
Atletico play Madrid on Sunday at the Santiago Bernabeu Stadium.
Madrid opened the scoring against Getafe with a header by Joselu in the 14th minute after a well-placed cross by Lucas Vázquez from the right side. Joselu doubled the lead with a low shot from inside the area in the 56th.
Vinícius Júnior missed a couple of clear chances in one-on-one situations in the second half. Getafe found the woodwork once while trailing 2-0.
Carlo Ancelotti's team has won 20 games during their 25-match unbeaten streak.
"It was a superb match for us," said Ancelotti, who rotated some of his players ahead of Sunday's derby. "We are enjoying a good run and the team is motivated. We played well from start to finish, now we prepare for the derby."
Madrid defender Antonio Rüdiger did not return for the second half after sustaining a knock to a leg muscle before the break.
Ancelotti had few defensive options because of injuries and had to improvise with midfielder Aurélien Tchouaméni as a central defender alongside Nacho Fernández.
Ancelotti was shown a yellow card after the final whistle for complaining for a late penalty kick that was not called.
Getafe were coming off a win at Granada after three straight league matches without a victory. The club from southern Madrid stayed in 10th place.