How kakashi got sharingan?

He got it when Rin implanted Obito's sharingan into Kakashi's missing eye then obito died when the cave clapsed and a sad team left the grass village.but before that a rock jounin made him self invisible and he cut kakashi left eye(before he got the sharingan) then obito ask ri to implant his eye for kakshis birthday so ea im done:/