Clone Git repository with personal access token - github

I just created a new Github repository, and as I was about to clone it to start pushing files I realized I no longer managed to pass the authentication step. I have tried pretty much every combination of solutions I could find on the Internet, starting with how I used to do it (git clone https://<PAT>#github.com/<username>/<repo name>), and nothing seems to work. I also tried the <username>:<PAT>#github.com or oauth2:<PAT>#github.com variants among other things. When trying to push, I either end up having to enter a password that's no longer supported and inevitably fails, or I get straight up told my username or password are invalid. I also regenerated the PAT so it's not an expiration issue.
I know this is quite similar to other questions on this site, but none of their answers worked for me. Did Git change their authentication system again recently?

Related

SourceTree keeps prompting for credentials for an old and unused remote source

I pulled an old repo that has a submodule from e.g. stash.oldCompany.com/oldModule. I used to have credentials for it, but the entire thing was moved to a different public repo. I think the old repo still exists, but I sure don't have access there anymore.
Anyway, I entered vim .gitmodules and altered the submodule url to point at the public repo, and it works perfectly.
However - SourceTree still prompts me for credentials of the OLD url every single time I tab into SourceTree.
I don't have any repos that reference this URL anymore, directly or as submodule, yet it keeps prompting for credentials. Many people seem to be reporting similar behavior, and people keep suggesting entering SourceTree-settings and resetting the git-version, but I've tried that, but it still happens. That's a different problem anyway, because that's a prompt for logging into a repo they're actually using.
It feels like SourceTree is stuck in a loop of trying to authenticate me to a repo I accidentally attempted to pull as a submodule in a project that no longer utilize it. How do I get it out of this loop? It's driving me mad.

When i push into github from vs code it shows me the wrong user even though i have signed in with the right account

I am having a issue every time I push code into GitHub:
I have this account
and this is what it shows after I do a commit:
This is a name or nickname I have never used, and this shows for private repositories and public repositories as well.
After doing some research, I have removed Windows credentials of GitHub and VSCode to make sure that the issue does not stand there:
It did not resolve the issue.
I have tried the command to remove all credentials and add them again, I added them again but the issue still persists.
For some reason, every time I make a commit, unless I upload directly the code from github.com, it will show it with the wrong user as push.
Credentials are use to authenticate to GitHub, which check if your account (identified by the credentials) has the right to access/push to your remote repository.
This has nothing to do with commit authorship, which is only set by a local git config --global user.name or user.email.
Check first those settings, adjust them (especially the email one), and make/push another commit, to confirm they are properly displayed (with the right account)

Suddenly, on a single machine, my auth token doesn’t run anymore

Suddenly, in the middle of the day, github ceased to work in one of my machines.
I just git push from my development machine, then I write down my userid and paste my personal access token. Done.
Just a few seconds later, I switch to my AWS online server, then I git pull, write down my userid and then pasted (from the same clipboard) my personal access token.
The answer has been
remote: 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.
fatal: Authentication failed for 'https://github.com/pdipietro/kebraServer/'
Now, on that machine (Ubuntu 20.04.3) I cannot do any git operation: the result is always the same as above.
On my development machine, and in other servers, I tried to git push and git pull that project and some others, and everything runs good as always.
I tried also to reboot the machine, without success.
Then, I generate new personal access token to my github, and tried with it, too: the same result.
At the end, I wrote this same post to the github community, but Our automated spam filter, Akismet, has temporarily hidden your post.
Can someone help?
Suddenly, it restart to run correctly.
With no words for github community.
I have no words for this.

how to upload your local repo to a designated remote repo in Github when you have two Github accounts and one of them is set as default?

First of all, I tried to edit SSH/config file by adding a newly generated key, its hostname and so forth. Didn't work. Every time I tried to upload a repo to my personal github account, git would try to upload it to my work github account. My question is really, should I modify SSH/config or .git/config, are those two different? For the record, these are the sources of inspiration I am refering to here. (1)http://guides.beanstalkapp.com/version-control/git-on-mac.html
(2)https://www.youtube.com/watch?v=fnSRBRiQIU8
neither of them works. In addition, as I opened the SSH/config file, there is no trace of the SSH keys which is connected to my work github account, which I've been using for a while. I literally started using github actively two and a half months ago, and a colleague helped me set up everything. I am using a mac. Where is my work SSH keys stored?
Thank you very much! All of your advice would be deeply appreciated.

make GitKraken forget GitHub credentials

I cloned a project from Github, which went well. Then I pulled once and accidently entered the wrong credentials. Now I always get "failed to get server certificate: The handle is in the wrong state for the requested operation". So this looks like that problem but it can't be that TLS issue because cloning from that Github repo worked just a few minutes before (not anymore now). How can I make GitKraken forget my Github credentials? Settings→Integrations→GitHub→Disconnect did not do the trick. Adding a GitKraken SSH key to GitHub did not help either.
Update: Now I tried Forget All. The problem now is that GitKraken is asking me again and again for my credentials. But login to GitHub in browsers work. Why?
In the end I cloned the project again. Maybe this workaround also works for others.