Best solution would be : Step 1 : Generate PAT from gitHub ( Go to developers setting and generate) Step 2 : On VS code , enter "git credential-manager github login" Step 3 : Enter the PAT generated on the window prompted in vs code Step 4 : Clone repo
This works perfectly.