If one masturbates for some time and didn't know that he has to perform Ghusl because of the ejaculation; does he have to repeat all the fasting days and make up his prayers that he performed without the Ghusl?
Masturbation is a prohibited act and should be avoided with seeking forgiveness from the Almighty Allah and repenting to Him. The prayers that the person knows that he did after masturbating and before performing Ghusl should be repeated. It is not required to make up the fasts.