githubprivate-repositorycode-collaborator

Code not pushing into a private repository


Authentication failed. enter image description here

I just changed my laptop and i've added my info but its not allowing me to push to a private repository.

I've tried logging in and logging out, I've also removed myself from the project and adding myself back but to no avail.


Solution

  • Please do the following,

    1. Update Credentials: Run the following command:

      git config --global credential.helper cache

      Then, try pushing to prompt for credentials.

    2. Use Personal Access Token (PAT):If using HTTPS, generate a PAT on GitHub and use it instead of a password.

    3. Check SSH Key: If using SSH, ensure your SSH key is added to your GitHub account. Test with:

      ssh -T git@github.com

    4. Verify Remote URL: Check your remote URL with:

      git remote -v