Home > Back-end >  GIT initialization and connection to Github
GIT initialization and connection to Github

Time:11-21

I know this topic is just all over the place, and I was sincerely attempting for quite a lot of hours, and without shred of success.

My issue is that my git doesn't recognize my own repository. It provides me with the following error on any attempt to perform pull/push:

remote: Repository not found.
fatal: repository 'https://github.com/danieln-juno/bugreport.git/' not found

Now, I did not misspell the name of the repository/URL. Also, I do have an access as I am the owner of the repository.

when I perform the command git remote -v, I get the correct url:

 origin  https://github.com/danieln-juno/bugreport.git (fetch) origin 
 https://github.com/danieln-juno/bugreport.git (push)

My current local folder has been initialized, of course.

I'll just add that I had Git initialized and working along GitHub, up to the point I had to do a System Reset (Not format), plus I wanted to create and use a new GitHub account.

I'm using Windows10 with MINGW64 (Git Bash).

Any ideas what might be causing this issue?

Regards.

CodePudding user response:

You should have manager-core as a credential helper.
Check it is the case with:

git config --global credential.helper

Check what is stored in that helper:

printf "host=github.com\nprotocol=https" | git-credential-manager-core get

If you do see your GitHub account password, instead of a GitHub PAT (Personal Access token), remove it, and store the token.

printf "host=github.com\nprotocol=https\nusername=danieln-juno" | git-credential-manager-core erase

printf "host=github.com\nprotocol=https\nusername=danieln-juno\npassword=yourToken" | git-credential-manager-core store

CodePudding user response:

without VonC's answer, I wouldn't be able to solve the issue.

When I was following his steps, trying to to the following command:

printf "host=github.com\nprotocol=https" | git-credential-manager-core get

I have noticed that my former GitHub user was saved.

I have erased the credentials, from 'start button' -> 'credential manager' -> 'windows credentials' -> under 'generic credentials', remove git:https://github.com credentials.

Then, I was also performing the following command:

git config --unset credential.helper

Afterwards, I have performed:

printf "host=github.com\nprotocol=https" | git-credential-manager-core get

and performed a login authentication with GitHub.

The last steps, were as he stated:

printf "host=github.com\nprotocol=https\nusername=danieln-juno" | git-credential-manager-core erase

printf "host=github.com\nprotocol=https\nusername=danieln-juno\npassword=yourToken" | git-credential-manager-core store

VonC deserves all the credit. I just wanted to add small points that might help to future programmers. Hopefully it will help many more to come.

  • Related