Having considered this a few times, I believe the car jacker just wants the car.
My life isn't worth the car.
I calmly tell the robber "Okay, you can have the car. I'm going to get out."
As I exit, his attention will be on securing the vehicle - not likely shooting me.
Now, timing here is important. As he gets in the car, this is your opportunity to flee, toward the back and diagonal weaving behind cover, while his attention is entering the car. If you're standing there, you're foolish. Alternately, move behind and diagonal to the car, and shoot the robber. I think you're well within your legal right to shoot him during his commission of a violent felony with a firearm.
If forced somehow to stand there, at gunpoint, assuming I'm armed, I'll say something to distract him, like, "There's $5000 cash in the glove box."
A rational person (assuming a rational crook, not just a homicidal maniac in which case you're going to get shot no matter what) isn't going to shoot me as his next act. His next act will be to look in the glove box. His attention will be away from me. This is the opportunity to either move, draw and shoot him, or flee.
Now, having said that my life isn't worth a car, it would be a split second calculus whether to flee if given the opportunity, or act in self defense. This would be determined based on infinite factors (gut feeling, numbers of perps and guns, situation, proximity of cover - am I in an open parking lot, or are is there nearby cover - type of gun perp has - Jennings .22 or Ruger .357 - and a host of other variables).
Here's a good and short 2 min video worth watching.
https://www.youtube.com/watch?v=-tHAV1l6NFE
Edited to add the following thoughts:
1. The best defense here is a good offense. AVOID these situations. BEWARE of dangerous areas. These include, sitting in a parked car in a lot, side of the road, ATM, etc for more than a moment. The darker and more secluded the more dangerous they are. AVOID being the first car at the stop light in an urban area where someone can get the jump on you, especially at night, and in a sketchy area of town ("wall art," liquor stores, check cashing stores, vacant buildings and lots, etc.). In times you cannot avoid these areas, be on high alert and have gun out and ready.
2. My answer above assumes I'm alone in the car. Compliance until/unless I suspect this is a murder and not a robbery. The analysis changes if it appears it's a murder, or I'm defending a child or other person in the car.
3. Never go along as a kidnap victim. Distract and fight or flee immediately.