You can make some logic gates from just diodes and resistors, this is called diode logic or diode-resistor logic.
However without a transistor, you can only do gates without negation, namely AND and OR:
The problem with either of these, is that the output level can never reach the value of the inputs, due to current drain through the resistor,
and the diode drops in the diodes. So after several stages, the signal becomes useless. Plus, most logic circuits require negation (NOT)
gates at some point, which can’t be done with diode-resistor logic.
However resistor-diode logic was widely used in some early vacuum tube computers, because it reduced the number of tubes needed.
The tubes were used to restore the signal level and do negation as needed.
When transistors replaced vacuum tubes, they were used to restore the signal level. This also inverts the signal, so the AND gate above
become a NAND (NOT AND) and OR gate became a NOR (NOT OR). This is actually a good thing, because any logic circuit can be made
up of just NAND’s or NOR’s.
2-input DTL NAND gate
So resistor-diode logic transitioned to resistor-transistor logic (RTL), then diode-transistor logic (DTL), and finally transistor-transistor logic (TTL),
all using bipolar transistors (BJTs), before being replaced mostly by CMOS logic using (field effect transistors (FETs).
The Apollo Guidance Computer, that flew men to the moon in the late 1960’s, used only RTL gates, all of the same type -- 2,800 ICs, each with
dual three-input NOR gates.
3-input RTL NOR gate used in the Apollo Guidance Computer.