Cook the spaghetti al dente, according to the package directions. Reserve ½ cup of the pasta water and drain.
Meanwhile, add the garlic, green olives, parsley, and basil to a food processor. With the motor running, slowly add the oil and process until fully incorporated.
In a large skillet, over medium heat, cook the olive pesto for 2 minutes.
Add the spaghetti, reserved pasta water, black olives, and salt and cook until the water is absorbed and the spaghetti is heated through.