A federal judge agreed yesterday to delete hiring goals from a consent decree involving affirmative action for San Diego city workers, hours after the city and Justice Department filed a motion seeking the deletion.

It was the first time the Reagan administration has filed such a motion with a jurisdiction's consent. The Justice Department has filed similar motions in Indianapolis and Buffalo, but over the objections of those cities.

The Justice Department agreed in spring 1984 to ask a court to delete the hiring goals, according to San Diego personnel director Rich Snapper.

The San Diego case is different from some affirmative-action cases nationwide because, by agreement, the decree could have been ended any time after 1982 if its goals were met. Some cases involve consent decrees not yet subject to termination.

The agreement between the government and San Diego came before the Supreme Court ruled last June in a case involving Memphis firefighters that bona fide senior- ity systems supersede affirmative- action plans. Assistant Attorney General William Bradford Reynolds has cited that ruling in Memphis Fire Department et al. v. Carl W. Stotts as justification for federal attempts to delete hiring goals from decrees.

The San Diego agreement also came before the Justice Department asked 50 jurisdictions earlier this year to join the department in court attempts to delete hiring goals from their consent decrees.

Barry Goldstein, a lawyer for the NAACP Legal Defense and Educational Fund, said the department motion in the San Diego case had "nothing to do with Stotts . . . . The whole goal of affirmative action is to get rid of prior discrimination," he said. "If the Justice Department is to be believed" in contending that San Diego has met its affirmative-action goals, "then the affirmative-action plan has worked."

The San Diego decree came after a 1976 Justice Department suit alleging a pattern and practice of employment discrimination in municipal jobs. The motion yesterday asked the U.S. District Court in San Diego to delete all numerical goals from the decree and stipulated that the city hire and promote "on a nondiscriminatory basis from among qualified applicants."

In June 1984, 12.2 percent of the city's firefighters were Hispanic and 6.2 percent black. Women hold 7.1 percent of firefighter positions, the motion said. The city has a minority work force of 18.4 percent.