I had an inguinal hernia open surgery 6 months ago. I want to know which exercises I can do that will help me gain weight and also stay in shape.

Nothing specific . There are no specific exercises that need to be done, or limitations of types of exercises six months after inguinal hernia repair. If you think there is a problem, contact your surgeon. Hope this helps!