The sharp pain
on moving neck suggests that there may be compression on the nerves coming out in the neck region. The common cause is cervical spondylitis
. However you are young and spondylitis generally occurs in later ages. Still you need o be evaluated by a neurologist
or neurosurgeon and probably MRI scan of the neck will be needed. Other cause can be muscle or ligament injury
in the neck which is getting stretched in a particular position and causing pain. For migraine you can continue your migraine medications. For neck pain
, consult a physiotherapist also, who will teach some exercises.