1. 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:


    🔧 For macOS or Linux:

    ✅ Install via Homebrew (macOS/Linux):

    brew tap microsoft/git
    brew install --cask git-credential-manager-core
    
    

    ✅ Or use the installer script:

    curl -L <https://aka.ms/gcm/linux-install-source> | bash
    
    

    🪟 For Windows:

    If you're installing Git for Windows, it often gives you the option to include Credential Manager during setup — make sure it's checked.


    ✅ After installation – configure Git to use GCM:

    git config --global credential.helper manager-core
    
    

    (Older versions might just be manager or manager-core, depending on OS and version)


    🧪 Test it

    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