install Git Credential Manager (GCM) — which helps you securely store and use GitHub credentials like Personal Access Tokens — here's how you do it based on your operating system:
brew tap microsoft/git
brew install --cask git-credential-manager-core
curl -L <https://aka.ms/gcm/linux-install-source> | bash
If you're installing Git for Windows, it often gives you the option to include Credential Manager during setup — make sure it's checked.
git config --global credential.helper manager-core
(Older versions might just be manager or manager-core, depending on OS and version)
Once installed and configured, try pushing again:
git push origin main
It should open a secure GitHub login prompt or use your saved PAT/token.
Check if it’s installed correctly?
git-credential-manager-core --version