If you are on windows, cloning with https may be a better option for you. You don’t have to set up ssh agent (which sounds alien for most windows user). You also don’t have to enter password every time you use, you can cache your password by following github’s article. In short, make sure you have msysgit 1.8.1 and above and set credential helper as follows:
git config --global credential.helper wincred
Two factors authentication
But after you enable 2FA, the above method doesn’t work anymore. We need a few more steps to make https url work with 2FA.
- Go to Github application settings
Generate new token
- Note down your token.
- Go to Windows Credentials Manager
Add a generic credential
- Enter your credential with the generated token. Note that address format is
That’s all, you should now be able to push without entering any username and password.