I forked a private repository that I was invited to collaborate on but every time I try to clone with HTTPS, I get the following error message:
$ git clone https://github.com/usernamex/privat-repo.git
cloning into 'privat-repo'...
Username for 'https://github.com':usernamex
Password for 'https://[email protected]':
remote: Repository not found.
fatal: repository 'https://github.com/usernamex/privat-repo.git/' not found
Note: 'usernamex' and 'privat-repo' are just examples
Here's some things I have tried with no success:
download ZIP
button. git clone
and git push
. In fact, I can clone and push other (public) repositories in my account.I am running git 2.10 on a mac through Terminal and, as I mentioned, I am not interested in workarounds to HTTPS (e.g.: SSH or GitHub Desktop).
Any ideas why this is happening?
To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
Note: The “fatal: 'origin' does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the exact location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.
What does “fatal: not a git repository” mean? This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right directory.
This Github document reads:
The
https://
clone URLs are available on all repositories, public and private.
But since you are trying to access a private repository, authentication is required. One way is appending username and password the address as below:
git clone https://username:[email protected]/usernamex/privat-repo.git
But the same page reads:
If you have enabled two-factor authentication, or if you are accessing an organization that uses SAML single sign-on (SSO), you must authenticate with a personal access token instead of your username and password for GitHub.
If you have 2FA enabled, check this page for steps to generate a personal access token. Bear in mind that you should check full repo
scope (as shown below) for your personal token.
I was also experiencing some issues with github credentials today, since it appears the user/pass authentication has been deprecated:
Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
I ended up adding a new SSH key for github authentication. And, important notes:
Don't use HTTPS to clone:
git clone https://github.com/USERNAME/REPO.git
Instead use SSH to clone:
git clone [email protected]:USERNAME/REPO.git
Don't use HTTPS as your upstream in .git/config
[remote "origin"]
url = https://github.com/USERNAME/REPO.git
Instead use SSH as your upstream in .git/config
[remote "origin"]
url = [email protected]:USERNAME/REPO.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With