Without suspended striker Robert Lewandowski, Barcelona created few noteworthy chances, but did just enough to emerge with the three points to drive on their bid for a first league title since 2019.
Second place Real Madrid face Athletic Bilbao later Sunday and Barcelona increased the pressure on the champions, whom they also beat to win the Spanish Super Cup last weekend.
Xavi Hernandez's side have won six games in a row across all competitions and fans chanted the coach's name in the final stages despite a sub-par display.
The coach selected Ansu Fati up front in place of Lewandowski but the young Spain international struggled to get into the game.
The whole Barcelona side took a while to get going on a chilly night at Camp Nou, with Borja Mayoral almost drawing first blood for Getafe, but his goal was disallowed for offside.
Barca's first real chance came in the 35th minute and was converted by Pedri from close range, turning home Raphinha's cross after a great interception by Andreas Christensen set the Brazilian free.
Former Real Madrid striker Mayoral should have equalised for the visitors but was denied by Marc-Andre ter Stegen when through on goal, after a poorly judged Pedri back-pass.
Barcelona's German stopper is back to his best this season after a long dip in form and that is reflected in their sparkling defensive record.
The Catalans have kept 13 clean sheets in 17 La Liga matches, conceding just six goals in the top flight.
Ter Stegen tipped over a Mayoral cross-shot early in the second half but beyond that he was barely tested.
Getafe's backline proved stubborn and Barcelona created few opportunities to add to their lead.
French winger Ousmane Dembele was a little fortunate to avoid a red card for a studs-up tackle on Omar Alderete as his frustration showed.
Dembele went on to carve out a chance for substitute Franck Kessie but the Ivorian fired straight at Getafe goalkeeper David Soria.
Fati fired over towards the end, his wayward effort summing up a tough evening.
Getafe had a chance to level in stoppage time, when Juanmi Latasa got the jump on Sergio Busquets at a free kick but headed straight at Ter Stegen.
Earlier Villarreal, fifth, needed a penalty after 100 minutes to beat mid-table Girona 1-0. Dani Parejo converted.
Gerard Moreno had missed a penalty in the 93rd minute but the hosts were awarded another in the final seconds.
Bottom of the table Elche earned a 1-1 draw against Osasuna, seventh, but remain without a win this season in the top flight.