The House Government Operations Committee jolted the oil industry yesterday, voting to make the U.S. government the sole purchasing agent of imported oil.

The provision, long opposed by the domestic oil industry as a first step toward nationalization, was written into the bill creating a Department of Energy that the committee is expected to finish shaping today.

Foreign oil, which now accounts for about half the U.S. consumption, is purchased by seven major companies such as Exxon and Mobil from the Arab oil and other exporting countries that quadrupled their price three years ago.

Supporters of the amendment offered by Rep. John Conyers (D-Mich.) argued that the U.S. government as sole purchaser of about $30 billion worth of foreign oil a year could make a better bargain with the Organization of Petroleum Exporting Countries than the private companies acting individually, and thus possibly hold down U.S. prices.

The committee vote was along party lines except for Chairman Jack Brooks (D-Tex.) who voted against it. The Carter administration had not asked for such authority.

Two years ago liberals tried to attach such a provision to an energy bill and failed in both House and Senate.

Rep. Abner J. Mikva (D-Ill.), who led the flight for the provision before, said the private oil companies who buy OPEC oil, which is then brought here and sold at the OPEC-dictated price, have neither the interest nor power to bargain down the price of foreign oil.

The big domestic oil companies benefit from high OPEC prices because those rates set prices here, said Mikva. And when the oil companies are accused of being "patsies" for OPEC, they reply that they don't have the power acting alone to bargain with a group of countries constituting an oil monopoly.

Sending the U.S. government as sole agent to bargain for the huge amount of foreign oil consumed here probably would not roll back OPEC prices, said Mikva, but should stabilize them.

A spokesman for Standard Oil of Indiana, one of the large oil companies said the company opposes the provision as a first step toward nationalization of the oil industry - "if the way we handle oil."

The oil spokesman said the provision would bring oil price negotiations into the political arena that would embroil them in issues such as the Arab boycott, when they should be commercial discussions. He also said private companies could get a better price from OPEC than government because the companies could make "quiet deals" in closed meetings.

The Department of Energy bill is also being marked up by the Senate Governmental Affairs Committee. Chairman Abraham A. Ribicoff (D-Conn.) said yesterday he has hopes of reaching a compromise with the administration on who should have the power to set the price of natural gas.

President Carter wants the power given to the energy secretary. Ribicoff said this gave too much power to one person and proposed vesting it in a commission, with veto power to the secretary. The compromise may be a suggestion by Sen. Charles H. Percy (R-Ill.) that would give the President power to resolve a dispute between board and secretary.