You are already using github and comfortably pushing code via command line, but recently you have enabled 2FA on your Github.
So now when you would like to push code to github via command line, you need to use access token to set the things as earlier.
Here is the process which I followed :
Step-1: Get access token from command line (https://help.github.com/articles/creating-an-access-token-for-command-line-use/)
Step-2 : Store this token to a safe place , this is your new password actually
Step-3 : Go to your repo , and type any git command e.g. git pull (See below), It will ask your user name and password, user name is your existing user name and pass word id the access token, and then its all set.
Sumits-MacBook-Pro:—- eSumit$ git pull
Username for ‘https://github.com’: [email protected]
Password for ‘https://[email protected]@github.com’:
For Personal access Token : https://github.com/settings/tokens