-
Go to GitHub > Settings > Developer Settings > Personal access tokens > Generate new token, and copy it
-
Create _netrc under
C:\Users\<username>, write the following content into it:machine github.com login <username> password ghp_***************************** -
Then git bash will use this token to communicate with remote server
-
Creating a personal access token - GitHub Docs
-
Git - How to use .netrc file on Windows to save user and password - Stack Overflow