How did India get independence from colonial rule

Non vioalence movement and violence movement both were prevalent, huge number of discussions, fights,protests etc paved way for indepdence