I know exactly what you’re talking about. Its called an exertional headache and I’m getting over them as we speak. I can’t tell you how much it pissed me off. I took a week off of lifting to relax and it didn’t cure it.
I got it either squatting or doing cleans.
First. Don’t hold your breath when you lift. I think its called valsalva and its pushing against a closed glottus, think taking a large shit. It raises blood pressure or something and it is not good for you. Just don’t do it anymore. Learn how to breath when you lift.
Second. I ended up diagnosing mine as a strained trap on my left side. It was just unusually tight and I think pulling on my skull, and I ended up with a throbbing headache on the left side of the back of my head about ear level. BOOM-BOOM-BOOM it felt like and it ended my workouts.
This stretch helped me immensely:
I also did neck rolls, forward and back neck stretches, and whatever else I could to make sure my neck was loose, mobile, and warm before trying to lift anything near my max effort [edit: this also had to do with my breathing when I was lifting things about as heavy as I could handle so learning to breathe is a big thing too]
Third. Two ibuprofen pretty much cured it for me. It came back when I was jumping rope about a week ago, and I popped two of those guys out of desperation and the headaches went away. I took two again today before I lifted and experienced no headache. I worked out on Monday though without them, and got through it. So it was more stretching than anthing. Tuesday, they came back a little and I took some ibuprofen and they went away.
Four. I think ice works better than heat, although neither of them really worked for me.
…That’s about it. I got over them in about a week. It might take you longer or shorter, but the stretches and ibuprofen helped me the most. There was a couple of posts about them, one was a 20-rep squat induced headache and here was another one I forget the name of. It can also be a sign of a bigger medical problem, so you might want to visit a doctor. I never did, but again I might wake up tomorrow dead from an aneurysm.