Mark Hamill spent almost thirty years insisting this scene was never filmed.
It was. In a cave on Tatooine, Luke snaps the final piece into his new lightsaber, ignites the green blade for the first time, slides the weapon into a hidden compartment inside R2-D2, and sends the droids ahead to Jabba's palace. It would have been the first lightsaber ever assembled on screen in a Star Wars film.
The cave moment came bolted to another cut shot: Vader reaching out to Luke through the Force from his meditation chamber. Leaving it in would have told the audience these two were connected almost a full hour before the movie actually reveals it.
Here's the part that ties back to your saber question. The blade was supposed to be blue, same as Luke's old one. But during the Sarlacc pit fight he holds it up against the blinding Tatooine sky, and a blue blade washed out on camera, nearly invisible against all that light. So they recolored it green to read against both the sand and the sky.
The most recognizable weapon in the saga is green because of a visibility problem.
Lucas and Richard Marquand then cut the cave scene for pacing. The result: Luke walks into Jabba's palace already in black, already a Jedi, and the green saber materializes out of R2 mid-firefight with zero setup.
That gap is the whole trick. Film the kid screwing parts together in a cave and you explain the magic away. Cut it, and a farm boy returns to the planet he grew up on as a fully formed Jedi, and nobody has to say a word about how.
Lucas finally screened the footage at Celebration V in 2010, twenty-seven years after release. Hamill was sitting right there.
Return of the Jedi (1983) has a deleted scene where Luke Skywalker builds his green lightsaber alone in a cave
George Lucas cut it
In the film the lightsaber appears with no explanation of where it came from