-
For windows users I suggest to download Git for Windows and install it (preferably the bash version and not the gui one).
-
Authenticate using Github CLI tool
gh auth login
? What account do you want to log into? GitHub.com ? What is your preferred protocol for Git operations? HTTPS ? Authenticate Git with your GitHub credentials? Yes ? How would you like to authenticate GitHub CLI? Login with a web browser ? Press Enter to open gi [...]
-
Without the CLI tool, you can use the Personal Access Token to authenticate with the command line.
Once you setup the token, you can use it to authenticate with the command line like a password. With the following command, you will store your credentials globally on your computer in plain text.git config --global credential.helper store
With the following command, you will store your credentials in memory for 15 minutes (default). You can change the timeout by setting the
credential.helper
value tocache --timeout=3600
(1 hour).git config --global credential.helper cache git config --global credential.helper 'cache --timeout=3600'
-
Without the CLI tool, you can use the SSH Key Pair
-
After that you are all set to use git commands, without having to enter your username and password every time you want to push or pull.